Hacker News new | past | comments | ask | show | jobs | submit login
The Mathematics of Tetris (2011) (math.stackexchange.com)
68 points by jimsojim on Jan 11, 2016 | hide | past | favorite | 14 comments



The top two answers are each interesting in their own way. The second answer, about the alternating colors, shows an elegant proof by induction.

The first (And accepted) answer, shows how important it is to account for edge cases! It also shows why legal contracts can be very long.


The first answer (5 Ts and 5 Ls) is quite interesting. Has anyone tried it with only using Ts and not using any other piece? Can we clear the game with even number of Ts?


I recently learned that the rules of Tetris are surprisingly subtle. For example, depending on how piece rotation is implemented, it may or may not be possible to clear three lines with a T piece ("T-spin triple").


Here is a list of all rotations systems known to be in use by various Tetris implementations: http://harddrop.com/wiki/Category:Rotation_Systems


By rotating the piece twice (and never reifying the intermediate position) immediately before/during the step that moves the pieces down


It's not so easy. You also need a small overhang above the hole, and make the rotation "kick" against the overhang to make the piece fit. I think in some implementations the rules for wall kicks actually allow you to climb up certain shaped walls, all the way back to the top of the screen.


I guess you are thinking of other orientations than straight up, as it is trivial to clear three lines with a T-piece:

   .....TTT..
   ......T...
   ......T...
   ..........


That's not a T piece. It has 5 blocks. The subtlety is about a board like

    .XXXXXXXXX
    ..XXXXXXXX
    .XXXXXXXXX
and if you can put a T piece inside of the gap on the left.


Oops. My mind is more pentomino-oriented, I guess.


All seven pieces ("tetrads", from "tetromino") in standard tetris have 4 blocks, not 5.


I don't understand this answer: http://math.stackexchange.com/a/80814


Perhaps you had the same misunderstanding that I initially did: I thought that the scenario was supposed to be a perfect clear with exclusively T pieces, but it actually allows any combination of other pieces. The answer is placing five T pieces in a way that clears the line containing their "odd color" tiles, then placing five L pieces to fill the remaining gaps.


Yes What happens is that blocks dropping from above a cleared line counteract the parity problem created by the odd number of T's. 5 blocks (an odd number) switch parity by moving one position orthogonally.

More generally, any odd number of line clears will reverse the parity of all remaining blocks above, which can be an odd number.


The answer is pointing out that the conjecture is false. Specifically, it shows an example where a "perfect clear" is achieved with an odd number of T pieces.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: