This is a simple SOS Game made using Python and Pygame. The game is Player vs AI, where the AI uses the Minimax algorithm to choose moves.
I first created this game in Java and then converted it to Python to better understand game logic and artificial intelligence.
GAME RULES
- Players place S or O on the board
- If a player forms S-O-S, they get 1 point
- If a player scores, they get another turn
- The game ends when the board is full
- Player with the highest score wins
FEATURES
- 5x5 board
- Player vs AI
- Minimax algorithm for AI
- Keyboard controls
- Score tracking
- Extra turn on scoring
- Simple UI using pygame
CONTROLS Arrow Keys : Move selection S : Place S O : Place O Enter : Confirm move
HOW TO RUN
-
Install Python https://www.python.org/downloads/
-
Install pygame pip install pygame
-
Run the game python main.py
PROJECT STRUCTURE sos-game/ | |-- main.py |-- README.txt
WHAT I LEARNED
- How board games are implemented
- How minimax algorithm works
- Game loop and event handling
- Keyboard input handling
- AI decision making
- Converting Java logic to Python
FUTURE IMPROVEMENTS
- Mouse support
- Restart button
- Difficulty levels
- Better graphics
- Bigger board size
- Add Animation for Point Scored
AUTHOR Mayank Chouhan Beginner Python & AI learner