Skip to content

my favourite games coded using AI tools in python with pygame, starting with 2048, minesweeper

License

Notifications You must be signed in to change notification settings

kumarana/simplegames

 
 

Repository files navigation

SimpleGames 🎮

Welcome to SimpleGames! This is an open-source project featuring classic games built with Python. The project includes both interactive and AI-enhanced features, making it ideal for anyone interested in game development, AI, and the power of Python.

📚 Table of Contents

  1. Features
  2. Tech Stack
  3. Installation
  4. Usage
  5. Future Plans
  6. Contributing
  7. License

🌟 Features

Current Games

  1. Minesweeper with Solver 🧩

    • The classic logic game where players uncover tiles and avoid hidden mines. Simple, fun, and challenging!
  2. 2048 with AI Solver 🔢

    • Enjoy the addictive 2048 game, where numbers merge to reach the 2048 tile!
    • AI Solver: A unique addition to this project, the AI solver is implemented using Flask and runs through HTTP requests. You can watch an AI tackle the game, exploring how an algorithm strategizes for optimal moves.
  3. Sudoku with Solver 🔢

    • The Sudoku Game with Solver in SimpleGames offers the classic puzzle experience where players fill a 9x9 grid following Sudoku rules. Additionally, it includes an AI-based solver that can help players find solutions.
  4. Chess Replay Viewer ♔♕

    • This project is a Chess Replay Viewer built with Python, Pygame, and python-chess. It reads a PGN (Portable Game Notation) file containing one or multiple chess games and visually replays each game move-by-move.

Usage

  1. Place your PGN file in the pgns folder (or provide the path to any other location).
  2. Run the script:
    python chess_player.py path/to/your_game.pgn

🛠️ Tech Stack

  • PyGame for interactive game interfaces.
  • Flask for hosting the AI-based 2048 solver.
  • HTTP Client to communicate with the AI solver for 2048.

🤖 AI-Generated Code

This project is also a showcase of AI-assisted development. Over 90% of the code was generated using tools like GitHub Copilot, OpenAI, and Claude. These tools helped streamline everything from game logic to integrating AI features, making SimpleGames a testament to the power of AI in coding.

🚀 Future Plans

We’re excited to keep expanding SimpleGames with more classic games and AI functionalities: Sudoku and Chess are done

Stay tuned for these additions and more!

🛠️ Installation

  1. Clone the Repository:

    git clone https://github.com/muonium-ai/simplegames.git
    cd simplegames
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Run the Games: Each game project has a readme in the folder

    • Minesweeper:
      python minesweeper.py
    • 2048:
      python 2048.py
    • 2048 AI Solver (starts Flask server):
      python ai_solver.py
    • The 2048 game can make HTTP requests to the AI solver to see AI strategies in action. Chess Replay Viewer
      python chess_player.py path/to/your_game.pgn

🎮 Usage

Each game has its own controls and guidelines:

  • Minesweeper: Left-click to uncover tiles, and right-click to mark mines.
  • 2048: Use arrow keys to move tiles and combine them. Try enabling the AI solver to watch the AI solve 2048 in real-time!

🌐 Contributing

Contributions are welcome! If you have ideas, bug fixes, or new features, please feel free to:

  1. Fork the repository.
  2. Create a new branch (feature/your-feature).
  3. Commit changes and open a pull request.

Check out the CONTRIBUTING.md for more details.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.


We hope you enjoy SimpleGames! Dive into the code, play around with the games, and join us in expanding this open-source project. Let’s have some fun with Python and AI! 🚀

TODO

  1. Test the code in linux and mac and fix their issues
  2. Remove codes which are not used anymore as code is in git repo in history
  3. standardise code and solver invoking across all the games

About

my favourite games coded using AI tools in python with pygame, starting with 2048, minesweeper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%