This is 2048 game code in Python. Tkinter library is used for this code so that we can use the grid method for the display. This way, the game can be played similar to its original form. This game takes the input from the arrow keys of the keyboard and takes actions accordingly. Separate functions are created for these operations.
Project created with:
- PyCharm Community Edition 2022.3
- Python 3.10.9
- Tkinter Library(requires Python 3.7 or up)
- Intall Python 3.7 or up
- Check if Python and pip installed
- Run to check: python --veresion & pip -V
- Install Tkinter using pip
- Run command: pip install tk
Use the arrow keys to move Up, Down, Left, and Right. The game will go on until reached 2048 or all the tiles are filled up and no move is left.
The output of the Gameboard, Start of the game, Winning Board, and Game Over Board.