<HTML>
<HEAD>
<TITLE>Java Gallery: Tetris Explained</TITLE>
<!-- Copyright (c) 1996 by The Geometry Center. All Rights Reserved. -->
</HEAD>
<BODY BGCOLOR="FFFFFF">
<!-- *Navigation-Links -->
<B>Up:</B> <A HREF="./"><I>Java Gallery: Tetris</I></A><BR>
<HR>
<p>

<!-- *Begin-Document-Body -->
<H1>Discussion of the Tetris Applet</H1>

Why do we care that we can't win this Tetris game?  We always lose
every Tetris game eventually.

<p>

Most Tetris games end because the player makes a sequence of mistakes
that let the board fill up.  If a player were perfect, it's possible
that they could play forever.  Several Tetris fans have attempted to
write computer programs to play the game and met with little success.

<p>

The pattern recognition and strategies most Tetris players rely on are
difficult to program into a computer.  However, it might be
theoretically possible to create a perfect computer Tetris player
which could successfully play Tetris until its plug was pulled.  The
arguments presented on this page prove that that is impossible.

<p><HR><p>

Why can't you win a Tetris game in which only alternating Z- and S-
shaped pieces appear?  There are two main reasons -- Z and S pieces
are skinny on the ends and fat in the middle, and the board is 2n
blocks wide, where n is an odd number (n=5).

<p>

By "skinny on the ends and fat in the middle" I mean that if you
rotate a Z or S piece so that it is only two rows high, it will
consist of one block on the left, one on the right, and two in the
middle.  If you set it down on your accumulated stack of Tetris pieces
in this orientation, you will add one, two, and one block to the
different rows of the stack.  If a row is deleted from the board, you
will still have one more block where the middle of the Tetris piece
landed than you did before the piece was placed.

<p>

Because my special Tetris game provides only Z and S pieces, that
discrepancy in the height of the stack can never be remedied -- no
matter what you do the middle rows will always have more blocks in
them than the outer ones.  Over time, these inequities will accumulate
if pieces continue to be laid down horizontally, and the game must
end.

<p>

A similar argument shows that if a Z or S is rotated to be two columns
wide (and three rows high), it must be placed in one of five two row
wide "lanes" that evenly divide the board.  If it lands straddling two
lanes, it will again contribute to an accumulation of pieces on the
stack that cannot be remedied.

<p>

Why is it important that there are five lanes on the board, and that
five is an odd number?  You can see from the statements I made above
that the only possible way to continue this special Tetris game
indefinitely is to stack the pieces head to tail in the lanes.  An
experienced Tetris player will quickly realize that unless S's are
stacked on other S's and Z's are stacked with Z's, holes form on the
board that can't be erased by stacking the pieces in their lanes.

<p>

However, because there is an odd number of lanes, there must always be
an unequal number of S's and Z's at the top of the stacks.  If you
continue to place S's atop S's and Z's atop Z's, this inequality will
make some of the stacks grow faster than others.  Eventually, you will
be forced to place a Z on an S stack, an S on a Z stack, or lose the
game.

<p>

Since stacking the pieces in lanes will force us to create "holes" in
the stack of pieces on the board that will eventually bring the game
to a close, we see that there is no strategy by which we can continue
this Tetris game indefinitely -- we must eventually lose.

<p>

If we return to the topic of our Tetris playing computer program,
probability says that allmost every Tetris game will contain a long
string of alternating S's and Z's.  Hence, even a perfect Tetris
player will lose almost every game he, she, or it plays.

<p>

For more details and the proofs of these statements, download this
<A HREF="tetris.ps">preprint</A> of my research paper on Tetris.

<!-- *End-Document-Body -->
<p>

<!-- *Navigation-Links -->
<HR>
<B>Up:</B> <A HREF="./"><I>Java Gallery: Tetris</I></A><BR>

<!-- *GC-Common-Footer -->
<HR>
<NOBR><A HREF="/"><IMG SRC="/pix/home.gif" ALT="[HOME]" ALIGN=MIDDLE></A>
<I>The Geometry Center Home Page</I></NOBR>
<p>
Comments to:
<A HREF="mailto:burgiel@geom.umn.edu">burgiel@geom.umn.edu</A><BR>
Created:  Jan 7 1996 --- 
<!-- hhmts start -->
Last modified: Fri Apr  5 11:43:52 1996
<!-- hhmts end -->
<BR>
Copyright &#169; 1996 by
<A HREF="http://www.geom.umn.edu/">The Geometry Center</A>
All rights reserved.
</BODY>
</HTML>
