DeepSquare is a feature-rich chess engine built in Python with Pygame, offering multiple AI algorithms, beautiful themes, and a complete chess experience. Whether you're a beginner learning chess or an advanced player testing your skills against sophisticated AI, DeepSquare provides an engaging and educational platform.
- Features
- Installation
- Usage
- Algorithms (AI)
- Future Enhancements
- Feedback and Contributions
- Player vs Player: Classic human vs human gameplay
- Player vs AI: Challenge yourself against intelligent computer opponents
- AI vs AI: Watch different algorithms battle it out
- Random Move: Basic random selection for casual play
- Minimax: Classic minimax algorithm with depth-3 search
- NegaMax: Optimized negamax implementation for better performance
- Alpha-Beta Pruning: Advanced algorithm with pruning for optimal play
- Multiple Themes: Choose from Classic, Blue, Brown, or Gray board themes
- Move Highlighting: Visual feedback for selected pieces and valid moves
- Smooth Animations: Beautiful piece movement animations
- Move Log: Real-time display of game history in algebraic notation
- Complete Chess Rules: All standard chess rules implemented
- Special Moves: Castling, en passant, and pawn promotion
- Game State Management: Check, checkmate, and stalemate detection
- Undo/Reset: Keyboard shortcuts for game control
- Responsive UI: Intuitive mouse and keyboard controls
- Python 3.7 or higher
- Pygame 2.0 or higher
# Clone the repository
git clone https://github.com/aman-chhetri/deepsquare.git
cd deepsquare
# Install dependencies
pip install pygame
# Run the game
python main.py- Launch: Run
python main.py - Select Theme: Choose your preferred board theme
- Choose Game Mode: Select Player vs Player, Player vs AI, or AI vs AI
- Select AI Algorithm : Choose from Random, Minimax, NegaMax, or Alpha-Beta Pruning
- Mouse: Click to select pieces and make moves
- Z Key: Undo the last move
- R Key: Reset the game
- Close Window: Exit the game
- White moves first
- Standard chess rules apply
- Special moves are automatically detected and executed
- Game ends on checkmate or stalemate
- Strategy: Completely random move selection
- Use Case: Casual play, testing, or when you want unpredictable opponents
- Difficulty: Very Easy
- Strategy: Classic minimax algorithm with depth-3 search
- Use Case: Good for learning and intermediate play
- Difficulty: Medium
- Performance: Evaluates all possible moves up to 3 moves ahead
- Strategy: Optimized negamax implementation
- Use Case: More efficient than minimax with same results
- Difficulty: Medium-Hard
- Performance: Same evaluation as minimax but with cleaner code structure
- Strategy: Advanced algorithm with alpha-beta pruning optimization
- Use Case: Strongest AI opponent, tournament-level play
- Difficulty: Hard
- Performance: Significantly faster than minimax/negamax with same results
DeepSquare/
├── main.py # Main game interface and UI
├── engine.py # Core chess logic and rules
├── ai_engine.py # AI algorithms and evaluation
├── assets/ # Chess piece images
└── README.md # Project Description
- Board Representation: 8x8 2D array with piece notation
- Move Validation: Comprehensive legal move checking
- State Management: Game state tracking and restoration
- Special Moves: Castling, en passant, pawn promotion
- Evaluation Function: Material counting + position-based scoring
- Search Algorithms: Multiple AI implementations
- Piece-Square Tables: Strategic position evaluation
- Performance Optimization: Alpha-beta pruning
- Pygame GUI: Responsive and intuitive interface
- Theme System: Multiple visual themes
- Animation System: Smooth piece movements
- Event Handling: Mouse and keyboard input
- Search Depth: 3 moves ahead for all AI algorithms
- Move Generation: Real-time legal move calculation
- UI Responsiveness: 15 FPS target for smooth gameplay
- Memory Usage: Efficient state management
- Opening Book: Add common chess openings
- Difficulty Levels: Adjustable AI strength
- Save/Load Games: Persistent game state
- Network Play: Online multiplayer support
- Analysis Mode: Move analysis and suggestions
- Custom Themes: User-defined board themes
- Sound Effects: Audio feedback for moves
- Tournament Mode: Round-robin AI competitions
It is publicly open for any contribution. Bugfixes, new features, and extra modules are welcome.
- To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
- To report a bug: If something does not work, please report it using GitHub Issues.
- Email: chhetryaman3@gmail.com
- X: @iamamanchhetri
- Website: Portfolio
- LinkedIn: @amankshetri
