🎮 A classic Snake and Ladder game with both Command Line Interface (CLI) and Graphical User Interface (GUI) implementations.
- 🎨 Beautiful Terminal Interface - Colorful and responsive UI with Rich
- 🎮 2-4 Player Support - Play with friends on the same machine
- 🎲 Animated Dice Rolling - Visual dice roll animation
- 🐍 Snake & Ladder Indicators - Clear visual cues for all game elements
- 🖥️ Graphical Interface - Play with a beautiful Pygame-based UI
- 🎨 Visual Animations - Smooth player movements and dice rolls
- 🎮 Interactive Controls - Click to roll, intuitive interface
- 🎵 Sound Effects - Immersive gameplay experience
- Python 3.7 or higher
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/Aryan01b/SnakeAndLadder.git cd SnakeAndLadder -
Install the required dependencies:
pip install -r requirements.txt
-
Switch to the CLI branch:
git checkout cli
-
Run the CLI version:
python SnakeAndLadder(CLI).py
-
Switch to the main branch:
git checkout main
-
Run the GUI version:
python run_game.py
-
Start the Game:
python SnakeAndLadder(CLI).py
-
Main Menu:
- Select option
1to start a new game - Select option
2to learn how to play - Select
Qto quit
- Select option
-
Game Setup:
- Enter the number of players (2-4)
- Enter each player's name
-
Gameplay:
- Press
Enterto roll the dice - Watch the animated dice roll
- The game will automatically move your token
- Land on ladders (🪜) to climb up
- Avoid snakes (🐍) or slide down
- First to reach 100 wins!
- Press
-
Start the Game:
python run_game.py
-
Main Menu:
- Click "Start Game" to begin
- Click "How to Play" for instructions
- Click "Quit" to exit
-
Game Setup:
- Select number of players (2-4)
- Enter player names
- Choose token colors
-
Gameplay:
- Click the dice to roll
- Watch your token move automatically
- Follow on-screen prompts
- First to reach 100 wins!
- Players take turns rolling a six-sided die
- Move your token forward the number of spaces shown on the die
- If you land on the bottom of a ladder, climb up to the top
- If you land on a snake's head, slide down to its tail
- To win, you must reach exactly 100
- If your roll would take you past 100, you stay in place
snake-and-ladder/
├── cli/
│ └── SnakeAndLadder(CLI).py # CLI version main file
├── gui/
│ ├── run_game.py # GUI version main file
│ ├── assets/ # Game assets (images, sounds)
│ └── src/ # Source code for GUI version
├── requirements.txt # Dependencies
└── README.md # This file
- Pygame - Game development library
- Numpy - For numerical operations
- Random2 - Better random number generation
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- User Guide - Complete guide to playing the game
- Developer Documentation - Technical details for developers
Interested in contributing? Check out our Developer Documentation for setup instructions, code structure, and contribution guidelines.
python snake_and_ladder_pygame.py- Players take turns to roll a dice.
- The player moves forward based on the dice number.
- If a player lands on the bottom of a ladder, they move up to the top of the ladder.
- If a player lands on the head of a snake, they move down to the tail of the snake.
- The first player to reach the last square on the board wins.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.
For any questions or feedback, feel free to open an issue or contact the repository owner.