Tetris
Autoplayer

Tetris has been released for virtually every computer and electronic gaming system, and it is often revered as a classic. Though numerous sequels have been spawned, Tetris games almost always have the same play mechanics: differently shaped blocks drop at varying speeds, and, as the blocks descend, the player must rotate and arrange them to create an uninterrupted horizontal row on the screen. When the player forms one or more solid rows, the completed rows disappear. The goal of the game is to prevent the blocks from stacking up to the top of the screen for as long as possible.

This implementation of tetris was made using Python's Pygame. The autoplayer was trained by randomly initialising the weights of a large population of models. The models would compete for the highest score. The difference between the best model weights and current model weights are used to alter and create a new model. A new generation is then created by randomly mutating the best model and introducing some randomly initialised models.