A modified 4x8 chess game implementation with AI players. This project implements a unique variant of chess played on a 4x8 board with a subset of traditional chess pieces.
This chess variant is played on a 4x8 board with the following pieces:
- Pawns (♟/♙)
- Knights (♞/♘)
- Bishops (♝/♗)
- Kings (♚/♔)
The game follows modified chess rules and includes features like:
- Bullet chess format (1-minute time control)
- Point-based scoring system
- AI player implementations
- Checkmate and stalemate detection
board.py: Core game engine implementation with move generation and validationai_player.py: Base class for AI player implementationsgame_runner.py: Game execution and visualizationconfig.py: Game constants and configuration
- Move validation and generation
- Check/checkmate detection
- Board state management
- Position history tracking
Base class for AI implementations with required methods:
get_best_move(): Calculate and return the best moveevaluate_board(): Heuristic evaluation of board positions
- Game visualization with Unicode chess pieces
- Time management for bullet chess games
- Score tracking and game statistics
- Move logging and display
- Board dimensions (4x8)
- Piece definitions and values
- Position evaluation tables
- Unicode symbols for pieces
Pawn: 20 points
Knight: 70 points
Bishop: 70 points
King: 300 points
Points are awarded for:
- Capturing pieces (piece value)
- Giving check (+2 points)
- Checkmate (+300 points)
To start a game between two AI players:
python game_runner.pyThe default configuration runs a 60-second bullet game between StandardPlayer and AggressivePlayer.
The project provides an AIPlayer template class in ai_player.py. To create your AI implementation:
- Complete the provided
AIPlayerclass by implementing:get_best_move(): Add your move selection logicevaluate_board(): Add your board evaluation strategy
- Adjust the
depthparameter in__init__as needed for your search algorithm - You can add additional helper methods to support your implementation
The template includes:
def get_best_move(self):
"""
Calculates and returns the best move for the current board state.
This method must be implemented.
"""
# Add your move selection logic here
def evaluate_board(self):
"""
Returns a heuristic score for the current board state.
This method must be implemented.
"""
# Add your board evaluation strategy hereWe welcome contributions to improve the Spartans Chess Tournament! If you find any issues or have suggestions for improvements, please follow these steps to create an issue on GitHub:
-
Go to the Issues page
-
Click on "New Issue"
-
Choose the appropriate issue template (if available) or create a blank issue
-
Provide the following information:
- Title: A clear, concise description of the issue
- Description: Detailed information about the issue, including:
- What you were trying to do
- What you expected to happen
- What actually happened
- Steps to reproduce the issue
- Environment (if applicable):
- Python version
- Operating System
- Any relevant dependencies
- Screenshots (if applicable): Include any relevant visual evidence
- Additional Context: Any other information that might be helpful
-
Submit the issue
- Search existing issues to avoid duplicates
- Use a clear and descriptive title
- Provide as much relevant information as possible
- Be specific about the problem
- Format code snippets using markdown code blocks
- Be respectful and follow the project's code of conduct
If you'd like to contribute code:
- Fork the repository
- Create a new branch for your feature
- Make your changes
- Submit a pull request with a clear description of the changes
For major changes, please open an issue first to discuss what you would like to change.