GNU bug report logs - #56116
Feature: new Tetris randomizer

Previous Next

Package: emacs;

Reported by: Timothée Denizou <denizoutimothee <at> gmail.com>

Date: Mon, 20 Jun 2022 21:43:01 UTC

Severity: wishlist

Tags: moreinfo

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56116 in the body.
You can then email your comments to 56116 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Mon, 20 Jun 2022 21:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timothée Denizou <denizoutimothee <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Jun 2022 21:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Timothée Denizou <denizoutimothee <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Feature: new Tetris randomizer
Date: Mon, 20 Jun 2022 23:41:42 +0200
[Message part 1 (text/plain, inline)]
Getting frustrated about having 4 time in a row the same tetromino ?

Wait no further !

This patch implement the seven bag randomizer, pulling a piece out of
the bag each time and filling the bag when it is empty. This allows for
a more uniform distribution on small samples.

At our school, we have plenty of time at the end of mcqs to play tetris
in emacs and this was something I wanted to change for a bit.

This is also my first contribution ever on an open source project.
The code may not be well formatted.
[Message part 2 (text/html, inline)]
[0001-Feature-new-tetris-randomizer.patch (application/octet-stream, attachment)]

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 21 Jun 2022 01:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Tue, 21 Jun 2022 11:00:03 GMT) Full text and rfc822 format available.

Message #10 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Timothée Denizou <denizoutimothee <at> gmail.com>
Cc: 56116 <at> debbugs.gnu.org
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Tue, 21 Jun 2022 12:59:03 +0200
Timothée Denizou <denizoutimothee <at> gmail.com> writes:

> Getting frustrated about having 4 time in a row the same tetromino ?
>
> Wait no further !
>
> This patch implement the seven bag randomizer, pulling a piece out of
> the bag each time and filling the bag when it is empty. This allows for
> a more uniform distribution on small samples.
>
> At our school, we have plenty of time at the end of mcqs to play tetris
> in emacs and this was something I wanted to change for a bit.

Thanks for the contribution.  But this would change gameplay
considerably -- in Tetris, you can get the same shape four times in a
row, while with your change, that's no longer possible.  I.e., it makes
the game less random, so I'm not sure that would be a welcome change.
(And you can predict which ones you'll be getting at the end of each
seven piece cycle by counting a bit.)

It might make sense to add it as an option, though.  Any Tetris players
here with an opinion?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 21 Jun 2022 11:00:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Tue, 21 Jun 2022 11:05:01 GMT) Full text and rfc822 format available.

Message #15 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Timothée Denizou <denizoutimothee <at> gmail.com>
Cc: 56116 <at> debbugs.gnu.org
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Tue, 21 Jun 2022 14:04:01 +0300
> From: Timothée Denizou <denizoutimothee <at> gmail.com>
> Date: Mon, 20 Jun 2022 23:41:42 +0200
> 
> Getting frustrated about having 4 time in a row the same tetromino ?
> 
> Wait no further !
> 
> This patch implement the seven bag randomizer, pulling a piece out of
> the bag each time and filling the bag when it is empty. This allows for
> a more uniform distribution on small samples.

Thanks.  A few comments below.

> At our school, we have plenty of time at the end of mcqs to play tetris
> in emacs and this was something I wanted to change for a bit.
> 
> This is also my first contribution ever on an open source project.
> The code may not be well formatted.

This patch is small enough for us to accept it unconditionally, but if
you plan on contributing in future, we'd need you to sign copyright
assignment papers.  If you're okay with that, I will send you the form
to fill and the instructions to go with it.

> Subject: [PATCH] Feature new tetris randomizer
> 
> * Added 7 bag randomizer for tetris
>  A piece is selected from the bag and removed each time we want a piece
>  When the bag is empty, refill the bag with the seven piece and shuffle it

Please use our conventions of formatting commit log messages like
ChangeLog entries.  You can find the details in the file CONTRIBUTE.

The description enough is good, but maybe a better place for it would
be a comment near the relevant code.

> +(defun tetris-shuffle (sequence)
> +  (loop for i from (length sequence) downto 2 do
> +    (rotatef (elt sequence (random i))
> +             (elt sequence (1- i))))
> +  sequence)

I guess you meant cl-rotatef?  rotatef is unbound in "emacs -Q", even
after I load tetris.el.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Tue, 21 Jun 2022 13:09:02 GMT) Full text and rfc822 format available.

Message #18 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56116 <at> debbugs.gnu.org,
 Timothée Denizou <denizoutimothee <at> gmail.com>
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Tue, 21 Jun 2022 18:38:10 +0530
[செவ்வாய் ஜூன் 21, 2022] Lars Ingebrigtsen wrote:

> Timothée Denizou <denizoutimothee <at> gmail.com> writes:
>
>> Getting frustrated about having 4 time in a row the same tetromino ?
>>
>> Wait no further !
>>
>> This patch implement the seven bag randomizer, pulling a piece out of
>> the bag each time and filling the bag when it is empty. This allows for
>> a more uniform distribution on small samples.
>>
>> At our school, we have plenty of time at the end of mcqs to play tetris
>> in emacs and this was something I wanted to change for a bit.
>
> Thanks for the contribution.  But this would change gameplay
> considerably -- in Tetris, you can get the same shape four times in a
> row, while with your change, that's no longer possible.  I.e., it makes
> the game less random, so I'm not sure that would be a welcome change.
> (And you can predict which ones you'll be getting at the end of each
> seven piece cycle by counting a bit.)
>
> It might make sense to add it as an option, though.  Any Tetris players
> here with an opinion?

Full disclaimer: I am only an occasional Tetris player, and I haven't
played other Tetris implementations (nor the original), I quickly tried
out one game with and without the patch, I think `random' makes the game
more challenging to play.  Part of the fun when playing this game,
although very frustrating, is figuring out how to manage the playground
when Emacs throws you the same block five times (especially the Zs!!)
but the uniform distribution kills this aspect.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Tue, 21 Jun 2022 18:33:01 GMT) Full text and rfc822 format available.

Message #21 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Timothée Denizou <denizoutimothee <at> gmail.com>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 56116 <at> debbugs.gnu.org
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Tue, 21 Jun 2022 19:37:42 +0200
[Message part 1 (text/plain, inline)]
Le mar. 21 juin 2022 à 13:04, Eli Zaretskii <eliz <at> gnu.org> a écrit :
> This patch is small enough for us to accept it unconditionally, but if
> you plan on contributing in future, we'd need you to sign copyright
> assignment papers.  If you're okay with that, I will send you the form
> to fill and the instructions to go with it.

I'm ok with that, do I need to provide an address ? One of my friend
worked on XBoard and signed his papers at our School located
14-16 Rue Voltaire, 94270 Le Kremlin-Bicetre. If you need to send any,
this is the address.

> I guess you meant cl-rotatef?  rotatef is unbound in "emacs -Q", even
> after I load tetris.el.

Yes cl-rotatef is the one.

> Please use our conventions of formatting commit log messages like
> ChangeLog entries.  You can find the details in the file CONTRIBUTE.

Thanks for the guiding. Should I remake the patch in order to comply ?

Le mar. 21 juin 2022 à 12:59, Lars Ingebrigtsen <larsi <at> gnus.org> a écrit :
> It might make sense to add it as an option, though.  Any Tetris players
> here with an opinion?

That is a good idea

Le mar. 21 juin 2022 à 15:08, Visuwesh <visuweshm <at> gmail.com> a écrit :
 > I think `random' makes the game
> more challenging to play.  Part of the fun when playing this game,
> although very frustrating, is figuring out how to manage the playground
> when Emacs throws you the same block five times (especially the Zs!!)
> but the uniform distribution kills this aspect.

Random definitely makes the game harder but it also makes it more
frustrating.
Modern tetris implementations (Tetris 99 and Tetris Effect) both
use the 7-bag randomizer, as well as a 'hold' cell and a preview of
respectively 6 and 4 pieces.
While this definitely reduce difficulty in a sens, it definitely adds
fluidity
and speed, as well as a more competitive aspect to it. Scores can get
much higher as well.

I propose this change mostly in this purpose (fun, speed and
competition) but I understand the more 'retro' style like the original
game or the NES version.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Tue, 21 Jun 2022 19:52:01 GMT) Full text and rfc822 format available.

Message #24 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Timothée Denizou <denizoutimothee <at> gmail.com>
Cc: 56116 <at> debbugs.gnu.org, Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Tue, 21 Jun 2022 21:51:27 +0200
Timothée Denizou <denizoutimothee <at> gmail.com> writes:

> Modern tetris implementations (Tetris 99 and Tetris Effect) both
> use the 7-bag randomizer, as well as a 'hold' cell and a preview of
> respectively 6 and 4 pieces.
> While this definitely reduce difficulty in a sens, it definitely adds fluidity
> and speed, as well as a more competitive aspect to it. Scores can get
> much higher as well.

Makes sense, but I can see people wanting both versions.  So I've pushed
your patch (with some changes) to Emacs 29, guarded by a new user
option, tetris-allow-repetitions.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 56116 <at> debbugs.gnu.org and Timothée Denizou <denizoutimothee <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 21 Jun 2022 19:53:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Wed, 22 Jun 2022 00:01:01 GMT) Full text and rfc822 format available.

Message #29 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Timothée Denizou <denizoutimothee <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56116 <at> debbugs.gnu.org, Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Tue, 21 Jun 2022 22:40:59 +0200
[Message part 1 (text/plain, inline)]
Thank you very much !

Le mar. 21 juin 2022 à 21:51, Lars Ingebrigtsen <larsi <at> gnus.org> a écrit :

> Timothée Denizou <denizoutimothee <at> gmail.com> writes:
>
> > Modern tetris implementations (Tetris 99 and Tetris Effect) both
> > use the 7-bag randomizer, as well as a 'hold' cell and a preview of
> > respectively 6 and 4 pieces.
> > While this definitely reduce difficulty in a sens, it definitely adds
> fluidity
> > and speed, as well as a more competitive aspect to it. Scores can get
> > much higher as well.
>
> Makes sense, but I can see people wanting both versions.  So I've pushed
> your patch (with some changes) to Emacs 29, guarded by a new user
> option, tetris-allow-repetitions.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56116; Package emacs. (Wed, 22 Jun 2022 02:26:02 GMT) Full text and rfc822 format available.

Message #32 received at 56116 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Timothée Denizou <denizoutimothee <at> gmail.com>
Cc: larsi <at> gnus.org, 56116 <at> debbugs.gnu.org, visuweshm <at> gmail.com
Subject: Re: bug#56116: Feature: new Tetris randomizer
Date: Wed, 22 Jun 2022 05:25:17 +0300
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 56116 <at> debbugs.gnu.org
> From: Timothée Denizou <denizoutimothee <at> gmail.com>
> Date: Tue, 21 Jun 2022 19:37:42 +0200
> 
> Le mar. 21 juin 2022 à 13:04, Eli Zaretskii <eliz <at> gnu.org> a écrit :
> > This patch is small enough for us to accept it unconditionally, but if
> > you plan on contributing in future, we'd need you to sign copyright
> > assignment papers.  If you're okay with that, I will send you the form
> > to fill and the instructions to go with it.
> 
> I'm ok with that, do I need to provide an address ? One of my friend
> worked on XBoard and signed his papers at our School located
> 14-16 Rue Voltaire, 94270 Le Kremlin-Bicetre. If you need to send any,
> this is the address.

Thanks, form sent off-list.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Jul 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.