# HOWTO play Tetris forever

Given a standard Tetris engine (which drops pieces in a pseudorandom order, has previews, and allows holding), this method will allow you to play Tetris forever. As always, the most fascinating thing about this is the specialized vocabulary used to describe the method:

Worst case bag distributions such as H?XX?X? and H?XXX?? deserve a special mention. The first piece 'H' denotes a piece which must be placed in Hold in order to follow the STZ loop procedure. Pieces from the LJO loop are denoted by '?', and the remaining pieces are denoted by 'X'. Using 3 previews and Hold, it is only possible to see the first 4 pieces of the bag before the second piece enters the screen. This means you only see H?XX, and only know the first piece of the LJO loop. Because H must be put in Hold, you are forced to make a decision without knowing the order of the rest of the LJO loop. If the O comes first, you can follow the procedure above without problems. The rest of the time you will run into complications like this:

### 33

1. jandrese says:

“Because the random generator provides strings of bags containing each of
the 7 pieces in a random order, it is possible to construct a strategy
around the relatively small variation, with looping patterns.”

Is this true?  I’ve played a lot of Tetris games and I can’t think of one that won’t send 3 or 4 Z pieces in a row, or make you wait many many tiles for that bar.

1. Tetris, when “done right”, does what they’re talking about. The longest you should have to wait for an I-block is 13 pieces, and three in a row should be impossible.

Tetris isn’t always “done right” though.

1. jandrese says:

Most of my Tetris experience was on Gameboy Tetris, did it do this?

1. Jorpho says:

If I’m not mistaken, the Game Boy Tetris algorithm tracked how much you were rotating a given piece, and weighed upcoming pieces accordingly.  If you rotate an I-block a whole bunch of times before placing it, you should accordingly see a lot more I-blocks.  (The algorithm was supposedly designed on the basis that a block repeatedly rotated is somehow more problematic, and that more of said blocks should be given to keep the game’s challenge up.)

I tried to find a source for this just now, but was unsuccessful.  I did find http://tetris.wikia.com/wiki/Random_Generator .

See also Bastet (aka Birdris, aka Bastard Tetris), which purposefully selects the worst possible block at all times.

1. The GB Tetris RNG urban legend crops up again. :) I’ve reverse engineered it first-hand, so I can confirm it’s not doing anything tricky about which pieces are more/less difficult to place.

It does have a huge bug that skews the distribution, though — while they tried to add protection against direct repetition, the way they check the last two pieces against the new candidate is flawed and ends up generating a lot of false positives. The L piece ends up getting the short end of the stick, and is only liable to appear ~10.7% of the time. The groupings work out such that O/S/T are more likely than J/Z/I, and everything is more likely than L. The technical discussion is on-going at http://tetrisconcept.net/forum/showthread.html?t=512&page=10

It’s worth noting that NES Tetris fixes this bug with a new protection method, among a variety of other subtle other improvements. I highly recommend NES over GB. :)

2. Jorpho says:

Wow, that’s nifty stuff.  But there are screenshots of people generating long streams of I-beams as evidence of the manipulation-theory; how can this be explained?

3. For some reason there wasn’t a reply option on your latest post, so I’m replying upstream. :p

>But there are screenshots of people generating long streams of I-beams as evidence of the manipulation-theory; how can this be explained?

The game collects does collect entropy for the randomizer from player input — or rather, the timing thereof. If you look at the code, the source for randomness in piece generation is one of the Game Boy’s constantly updating timer registers. The RNG can be manipulated by placing pieces on specific frames, though that’s more of a technique for Tool-Assisted Speedruns than something with real-time practicality. It’s possible that stalling a piece versus forcing it down straight away could impose some variance in the overall distribution, but I wouldn’t think it would necessarily be something with a concerted, observable effect.

2.  I know it didn’t have holding.

2. Those folks at tetrisconcept are the authoritative source of all things Tetris. While you’re on their wiki, explore it a bit– their stuff is fascinating.

3. peregrinus says:

Next month’s headline:  “Over 100 emaciated and dehydrated video-gamers hospitalised in wake of algorithm revelation”

4. nixiebunny says:

That is definitely not the language I’d use for Tetris, but then I only see shapes, not words, falling from the sky.

5. xzzy says:

I guess it’s been a long time since I played Tetris because I had no idea that “hold piece” was a thing these days.

Back in my day we took whatever piece the game gave us and liked it!

6. retepslluerb says:

I find this explanation far more convincing:

7. James Mason says:

What I find really interesting is that I can see how the Tetris website can be seen as a colossal waste of time and energy about a game that has collectively wasted eons of work-hours over the last few decades, or a really informative and detailed example of collaborative problem solving, programming, etc.  Like with pretty much everything, it’s all in how you choose to look at it.

1. -hms- says:

I’m really good at organizing my fridge now, though…

1. Donald Petersen says:

Seriously.  Even though I’ve never actually enjoyed Tetris, I’m a whiz at packing refrigerators and U-Hauls.

1. welcomeabored says:

Perhaps you need to graduate to an ABF trailer… for the challenge.

2. Gilbert Wham says:

I used to work in the stores at the local hospital with a guy who’d been there most of his life. Dude could stack boxes. And he was competitive about it.

8. -hms- says:

This story and the previous about Shadow of the Colossus strike me as really similar (perhaps that was the point) but in tetris where the world is less graphically and narratively engrossing, the zeal with which people track patterns and ascribe (potentially very real) meaning is even more stark. Except with SOTC the conversaion sounds like archeology and religion, whereas here, it’s more like cchemistry and quantum theroy…

9. the only way to play tetris is B type, at height 5 and speed 9.
It’s the only way to beat the game and see the ending.

how else do you find out tetris was just a communist launch code for missiles ?

C O N G R A T U L A T I O N S

10. SamSam says:

What’s interesting is that this algorithm won’t necessarily give you the highest score, it just allows you to keep going.

For example, between images 1 and 2,  the moment that first purple piece was placed it would have removed one line. Then after placing the blue piece it would remove the next three lines. The algorithm never removes four lines at once, giving you the lowest bonuses.

This wouldn’t matter for the algorithm in an ideal world, because an infinite playing time would give you infinite points, but Tetris is designed to be unplayable after a couple hundred rows, because the pieces move faster than the refresh rate of the buttons. So the world masters get the record-beating scores by trying to always remove rows four-at-a-time when possible.

1. Your final paragraph sounds to be more focused on the NES version. However, rulesets vary widely from version to version, — it’s more akin to a genre than a set game — and I’d say such brutal game-ending restrictions are actually in the minority. GB, Tengen, Atari, and Sega are all versions from the same era that are conducive (in various degrees) to marathon play. Most modern games are certainly playable indefinitely if not for explicit endings (i.e., “congratulations, you win” more than “it’s a kill-screen, you die” :) ) after clearing a fixed number of lines. It’s true that the Playing Forever pattern does not extend to 20G (or instant drop) speeds, but it’s possible that another more complicated pattern for max gravity play exists and highly likely that indefinite play is still possible even without such a strategy.

Also, with regards to NES’s kill-screen, it’s less that the pieces fall faster than the poll rate of the controller, and more that neither humanly possible to sustain rapid tapping speeds fast enough nor within the provisions of the default move speed to continue play for more than a handful of lines. There are two known players in the world to have “defeated Level 29 and reached 30 via rapid tapping to exceed the mobility provided by the default move rate of 10 per second. However, if we shed the limitations of real-time conditions via authorship of Tool-Assisted Speedruns, we can go even further; the only thing that stands in the way of indefinite play is a plethora of bugs that cause strange behavior or even soft lock the game as we progress into levels that were never intended to be reached.

11. Repeated z or s blocks have been trivially proven to eventually lead to a game over. Do they up-front ignore this fact?

1. jandrese says:

Apparently the version they are using places one of each piece in a bag and then empties the bag, so it’s impossible to get a repeated string of S and Z pieces.  I don’t think I’ve ever played a version of Tetris that does this, but I can see how it would make the game easier.

1. SamSam says:

Almost all versions of Tetris have some variation of this. Have you ever actually played a game that had all S or Z pieces?

The individual algorithms differ, but they all maintain some minimal separation between pieces. 2 in a row is possible (and common), but 3 in a row is generally impossible.

1. caitsith01 says:

Have you ever played a version of Tetris that DIDN’T have the capability of sending 3-4 of the same thing at you in a row?  Because I sure as hell haven’t.

12. eldueno says:

Yawn. Tetris and other games are great for wasting time or occupying someone’s mind who has nothing to think about.

1.  SWINE! “Tetris and other games = all games = wasting time!”
I suppose shagging for fun is a waste of time also.

If one has something (or indeed too much) to think about, a light hearted challenge can be therputic. When I was younger I was fascinated by the different puzzles Tetris threw at me, to this day I apply Tetris skills to real life (largely putting stuff in the fridge, freezer, cupboards, car, etc). I believe that considering tactics and making quick decisions in an ever changing landscape is excellent mental exercise.

13. bcsizemo says:

My parents have a neighbor who is probably 65ish and she still plays Tetris on the original NES that her husband bought back in like 89 or 90.  Every time I see her playing it makes me smile and blows my mind that the system still works.

14. Your Tetris has a hold function ???
MY Tetris kept dropping the pieces faster and faster until they were just raining down and there was no way to stop them.

15. caitsith01 says:

So in summary, this article should actually be called “HOWTO play Tetris forever assuming you manipulate the game code to give you the specific pieces you want first”.

1. No. As stated in the article, all features required to execute this pattern are standard to nearly all licensed Tetris games 2001 onward. Due to The Tetris Company’s “Guideline” standard, you’d be hard pressed to find a recent Tetris game in which the Playing Forever pattern is _not_ possible. The only major exception I can think of off the top of my head is Arika’s “Tetris: The Grand Master 3” (Arcade, 2005), which uses the series’s existing History 4 selection method instead of TTC’s standard Bag 7.

16. I actually learned that stacking technique at college when playing “The New Tetris” on the N64 (which is the best version I’ve ever played). It had a couple of extra rules, the main ones being that if you created a 4×4 block out of other bricks it would make a weird sound and turn silver. Any line cleared that included a portion of a silver block would have much better scores, but the real goal was to go for a gold block (a 4×4 made of all the same type of brick, so squares or lines or L shapes). Evolution of play taught us to build these blocks on the left and right side of the screen when possible, not being afraid to make them on the fly and quickly stacking the bits you didn’t want out of the way. The great thing about that version of the game- 4 players. No version has surpassed that bad boy in over a decade.

(Tip: turn game music off, keep sfx, listen to Lemon Jelly)