The classic 2048 game developed by Gabriele Cirulli recreated in pure Python with pygame with an Expectimax autosolver. (with smooth animations too :D)
- Interactive Sliding Tiles: Move tiles manually with the arrow keys.
- Live Expectimax* Solver: Press "S" to let the solver predict the best moves, and watch it live!
- Animated Moves: Watch each tile slide smoothly and pop just like the original web game!
- Easy Reset: Press "R" to reset the grid and your score
- Customisable Depth: Simply change the max depth in solver.py
- Python 3.x
- Pygame
-
Head over to the releases page
- Download the source code of the latest release.
- Install the required dependencies using pip:
pip install pygame
- Extract the contents of the file and run the
main.py
script to start the application.
-
OR clone the repository to your local machine:
git clone https://github.com/vSparkyy/2048-Expectimax.git
- Install the required dependencies:
pip install pygame
- Run the
main.py
script:python main.py
- Install the required dependencies:
-
OR press the green '<> Code' button and download the ZIP file:
- Extract the contents of the ZIP file into one folder.
- Run the
main.py
script to start the application.
- Arrow Keys: Move all tiles up, down, left, or right (if they can!).
- R: Reset the grid to its starting position.
- S: Toggle the Expectimax solver, press again to disable.
- Q: Continue the game if won already.
- Live Solving Animation: As the solver predicts the best moves, you can watch it seamlessly merge tiles live!
- Made by Harshil (vSparkyy)
- Fonts used: Montserrat Regular & Bold
- Inspired by the classic 2048 web game.
Contributions are welcome! If you find any issues or want to add more features, feel free to create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.