A python written game of Tetris - can be played by humans or by an AI. When a human plays the game, data is gathered that an AI can use to learn how to play the game
2. TetrisGo
Rrishi Anand
TetrisGo, is an AI that plays the
classic game Tetris. I made the game
in Python with the use of the PyGame
library. The AI plays the game,
controlling the movements of each
block.
3. Metrics
I collected data by playing my Tetris game, various
data of my keystrokes and the status of the game
where stored in a csv file. After playing the game, I
uploaded the csv file to my AI, to train it with.
5. Ai - Python Integration
Python Game
First, the Python game runs through the
tetris code. It picks a random shape and
begins dropping it through the screen.
Then it calls the AI, to make the decision of
how to manipulate the shape.
AI Input Into Game
Finally, the AI’s decision on how to
manipulate the block comes into the game,
and the blocks move to the AI’s whim.
AI Processing
Next, the already trained AI takes in the
data of the current status of the game and
predicts the direction the blocks should
move, to maximize the points.
03
01 02
6. nEXT sTEPS
Currently my AI is able to play my Tetris game without errors, however it does not play very well. Next, I would
like to improve the AI and make it play as well as a human, or maybe even better!