Code to run a Tetris game on various displays.
- WASD to move (w to snap)
- R to rotate
- x to close the game
- In the multiplayer mode, Arrows to move, RControl to rotate
To run with a pygame GUI, run app.py with one parameter "play":
python app.py play [cell-size]This requires you have pygame installed. For any of these commands you can include an additional int parameter "cell-size", which is the width of each Tetris tile in pixels. The default value is 50.
python app.py multiplayer [cell-size]This requires you have pygame installed.
python app.py trainP1 [cell-size]This agent is trained using a genetic algorithm using the parameters defined in /core/utilities.py
python app.py testP1 [cell-size]python app.py vsAI [cell-size]python app.py train2P [cell-size]This agent is trained using a genetic algorithm using the parameters defined in /core/utilities.py, playing against the single player agent.
python app.py test2P [cell-size]Tests the multiplayer-trained agent against the single player agent.
python app.py vsMPAI [cell-size]To run in terminal, run app.py with parameter "terminal":
python app.py terminalThis requires the package sty. Given how it uses colored text, I can only confirm it to run on Linux terminals (tested on Ubuntu terminal for Windows).
An LED panel display driver is currently in development.

