HP's Tetris


Title File Version Format
Tetris game tetris.zip 7.1 Windows binary, includes Allegro 4.2 runtime library (allegro42.dll)
Tetris AI Player tetrisai.zip 2.1 Windows binary, requires Allegro 4.2 runtime library (allegro42.dll)
Tetris Matrix Screensaver tetrismx.zip


Windows binary
Source code of all programs tetris_s.zip C++ source code, compiles with Visual C++ and MinGW. Project files for Visual Studio and Code::Blocks included.

Tetris game

The game was originally written in 1995, a time where I got hold of some Shareware Tetris games available for the PC. Most of them allowed a rich setup of game parameters or featured special modes, but none seemed to care enough for the "basic ingredients". Be it that the scoring system was rather pointless, that game speed increased too slowly or became unplayable, that the way of rotating blocks was not logical or consistent, or simply that bugs or never ending intro screens annoyed the player. I wanted a game as playable and polished as Atari's arcade machine, but with the game principle stripped down to its genius core. So this came to be...

tetris0.png tetris1.png tetris2.png


Tetris AI Player

Tetris AI Player is an application to demonstrate and measure the performance of my AI algorithm. The computer plays Tetris. After each set block (and all full lines cleared), the playfield is analysed. Among the collected data are the number of tiles (occupied playfield cells), the number of gaps (empty cells below a tile) and the pile height. Basic statistics can be viewed and saved to a text file. An example can be found here. The pile height has shown to be the most useful measure for evaluating and tuning the algorithm. The last screenshot below shows the pile height frequencies of a finished game with more than 440.000.000 set blocks.

legend.png autoplay0.png autoplay1.png

The AI algorithm knows the next block. It was developed with focus put on simplicity and speed, nonetheless it plays really well. It is by far the fastest algorithm I have seen. The AI player accomplishes at full speed 24.000 blocks/second on an AMD Athlon 64 2.20 GHz PC. The block sequence is generated by the Mersenne Twister pseudo random number generator.

Tetris Matrix Screensaver

Let the computer play Tetris in its spare time! This screensaver gives you the opportunity to watch up to 400 and more Tetris AI players at a glance.



For further information, support or feedback write to hp00@gmx.net.



Private Krankenversicherung