8 ms·
The Mathematics of Tetris (2011)
- cousin_it 11y agoI 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").
- Someone 11y agoI 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... ..........
- zeeboo 11y agoThat'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.
- Someone 11y agoOops. My mind is more pentomino-oriented, I guess.
- JoshTriplett 11y agoAll seven pieces ("tetrads", from "tetromino") in standard tetris have 4 blocks, not 5.
- tamana 11y agoBy rotating the piece twice (and never reifying the intermediate position) immediately before/during the step that moves the pieces down
- cousin_it 11y agoIt'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.
- yangman 11y agoHere is a list of all rotations systems known to be in use by various Tetris implementations: http://harddrop.com/wiki/Category:Rotation_Systems http://harddrop.com/wiki/Category:Rotation_Systems
- jedberg 11y agoThe 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.
- pavel_lishin 11y agoI don't understand this answer: http://math.stackexchange.com/a/80814 http://math.stackexchange.com/a/80814
- zhalie 11y agoThe 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.
- 0xcde4c3db 11y agoPerhaps 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.
- T-hawk 11y agoYes 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.
- nitin_flanker 11y agoThe 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?