
Is there a winning strategy in Tetris? - lainon
https://mathoverflow.net/questions/279656/is-there-winning-strategy-in-tetris-what-if-young-diagrams-are-falling
======
moomin
True story: the Cambridge Maths Society, The Archimedeans, had a journal
called Eureka (of course). It happily published interesting but not important
bits of mathematics. One student wrote a proof of an impossible sequence for
any width board. It's even impossible if you have perfect knowledge of the
sequence. All you need is to drop Ss and Zs in an irrational order.

I think this got published in 1990, but I can find little evidence even if the
journal's existence online.

~~~
anvandare
I think you mean this one? Of course it's also possible that multiple people
have published multiple proofs.

[https://www.researchgate.net/publication/2347389_How_to_Lose...](https://www.researchgate.net/publication/2347389_How_to_Lose_at_Tetris)

The proof itself is quite self-evident: given a perfectly randomly block
generator, and infinite play time, eventually you're going to produce a very
long sequence of left- (or right-) facing S-blocks. Since those are impossible
to eliminate (there's always one block left open on a row) eventually you
lose.

~~~
zeta0134
This actually isn't true for modern variants of Tetris. A correct
implementation of the random number generator requires that the 7 pieces be
shuffled into a bag and then drawn randomly, ensuring an even distribution,
and disallowing long runs without a desired piece. (Maximum of 12.) The bag is
re-shuffled every 7 blocks in the sequence.

[https://tetris.wiki/Tetris_Guideline](https://tetris.wiki/Tetris_Guideline)

[https://tetris.wiki/Random_Generator](https://tetris.wiki/Random_Generator)

Thus, in a game of Tetris adhering to these official guidelines, the longest
sequential run of S and Z pieces would be 4, in the following sequence:

[5 Random Blocks] [Z and S in any order] [Z and S in any order] [5 Random
Blocks]

I'd be very curious to see a proof of an impossible sequence which adheres to
the official rules, as that would be quite a feat indeed!

~~~
anvandare
In that case it would probably still be possible, but the proof would have to
be found by example. It seems like an advanced version of the Eight Queens
puzzle: which sequence of bags guarantees a losing board state?

------
reza_n
Search for "tetris championship" on YouTube. Some great tetris gameplay and
you can pick up on a lot of the strategy pros use.

Ex: [https://youtu.be/DdfRQjb5o9k](https://youtu.be/DdfRQjb5o9k)

------
freshyill
I once played a game of Tetris on the Nintendo DS (about 10 years ago now)
where I maxed out the lines… then the levels… and then maxed out the score.

I played this same game for weeks, mostly on the train to and from work. And
wouldn't you know it, but Tetris DS has a bug that won't let you save a score
once you pass 100,000,000 or whatever the highest possible score is.

Tetris got a lot easier when they added the ability to infinitely rotate a
block for as long as you want at the top of the pile.

------
a3_nm
There's a related annoying question for which I've never found a conclusive
answer: for the standard tetris board (width 10, height 22), is there a
strategy for the player that guarantees that they will be able to fill at
least one line? or conversely is there a strategy for the game (supplying the
pieces) to make the player die without having filled at least one line?

~~~
qntm
Yes, a strategy does exist which can force at least one line in a well of
width 10 (and different strategies for 4, 6 and 8). I did a tedious brute-
force calculation which demonstrated this a few years back. The code is not
particularly presentable and the calculation takes about 11 days on a modern
machine (it runs in a single thread), but here:
[https://github.com/qntm/tetris](https://github.com/qntm/tetris)

The limiting factor is headroom (the depth of the well). For wells of depth 0,
1 and 2, the AI clearly wins, but once the depth increases enough a strategy
becomes possible. My belief is that such a strategy exists for all even well
widths, although proving this is annoyingly hard.

~~~
a3_nm
Hi, thanks a lot for pointing this out to me! However
[https://qntm.org/tetris#sec6](https://qntm.org/tetris#sec6) does not have any
cases for width 10 where the player wins. Are you implying that you have run
more calculations than described in this article, and that the player can win
for width 10 with a sufficient high depth?

------
amptorn
"Tetris" has to be well-defined mathematically before it can be confronted as
a problem. Rules governing piece rotation behaviour, piece spawning, piece
randomization, wall kicks, loss conditions and even well dimensions need to be
laid out first.

~~~
bubblesorting
I have great news for you! [https://tetris.wiki/SRS](https://tetris.wiki/SRS)

------
arikrak
In classic Tetris you can slide the piece briefly after it lands, so you can
always keep the game going.

------
hughperkins
A strange game. The only winning move is not to play.

~~~
shellbackground
To reference:
[https://youtu.be/xOCurBYI_gY?t=15m57s](https://youtu.be/xOCurBYI_gY?t=15m57s)

It's fun how program learning to play teris pauses the game just before
loosing.

~~~
pitaj
Source of the reference is _War Games_ (1983).
[https://www.youtube.com/watch?v=6DGNZnfKYnU](https://www.youtube.com/watch?v=6DGNZnfKYnU)

------
mamon
I've always thought that the mechanics of Tetris are pretty straightforward
and it is always possible to arrange incoming pieces without any gaps. The
main difficulty for a human player is coming from the increasing speed, not
the pieces not fitting together.

~~~
Jaxan
If you only get z shapes (with the same orientation). Is it then possible to
avoid gaps? This is not clear to me at all.

~~~
__s
You can go infinite if only supplied Ss. You'll have intermediate holes which
will be filled in after the above row is cleared

~~~
Jaxan
Ah yes, of course!

