

The 19 orientations of Tetriminos used by Nintendo Tetris are encoded in a table located at $8A9C within NES memory. The sequence and the type IDs are important at a programmatic level, but it also manifests itself in the order of the pieces displayed in the statistics area (see below). The index into the sequence provides each Tetrimino with a unique numerical type ID. The pieces are depicted in the spawn orientations and the arrangement produces a nearly symmetric image, which might explain why they chose this ordering. The designers of Nintendo Tetris arbitrarily ordered the Tetriminos into the sequence shown above. The Mechanics of Nintendo Tetris Representing TetriminosĮach Tetrimino (tetri-mee-noh) has a single-character name that resembles its shape. Then, hit the Restart button on the Lua Script window. Toward the top of the file, you'll find the following line. To make it play faster, open the Lua script in a text editor.
#Nes tetris plus
to modify the keyboard mapping) and press Start, the resulting starting level will be 10 plus the selected value. The AI will take over from there.įrom the second menu screen, after you select the level, if you hold down gamepad button A (use Config | Input. In the second menu, you can change the starting level using the arrow keys. Press Start (Enter) to advance to the next menu screen. On slower computers, the music may play choppy you might want to disable it completely.
#Nes tetris free
Leave the game type as A-Type, but feel free to change the music using the arrow keys. The Lua script will direct you to the first menu screen. From the Lua Script window, enter the path to a or hit the Browse button to navigate to it. The game will launch.įrom the menu bar, select File | Lua | New Lua Script Window. In the Open File dialog box, select the Nintendo Tetris ROM file and press Open.

Runįrom the menu bar, select File | Open ROM. DownloadĮxtract lua/a from this source zip. Google might be able to help you to track it down. You'll also need the Nintendo Tetris ROM file (USA version). The AI was developed for FCEUX 2.2.2, the most recent version at the time of this writing. To run the AI, you'll need FCEUX, the all-in-one NES/Famicom emulator. Find out what colors appear in levels higher than any human has ever reached. You can witness the score max out while the line, level and statistics counters wraparound indefinitely. Finally, you can experience level 30 and beyond. Table of Contentsįor those lacking the persistence, patience and time necessary to master Nintendo Tetris, I created an AI to play it for you.
#Nes tetris how to
In this article, I explore the deceptively simple mechanics of Nintendo Tetris.Īfterwards, I describe how to build an AI that exploits them. Applying Artificial Intelligence to Nintendo Tetris Applying Artificial Intelligence to Nintendo Tetris Abstract
