This project implements a simple chess game with different types of players. The players can be either random or use the minimax algorithm to make decisions.
-
game/player.py
: Contains the abstract classPlayer
which defines the interface for chess players. It includes the abstract methodmake_move(self, board)
that must be implemented by any subclass. -
game/random_computer_player.py
: Implements theRandomComputerPlayer
class that inherits fromPlayer
. This class selects a random legal move from the given chess board. -
game/minimax_computer_player.py
: Implements theMinimaxComputerPlayer
class that also inherits fromPlayer
. This class uses the minimax strategy to determine the best move based on a specified depth.
To use the players, import them from their respective modules and create instances as needed. You can then call the make_move
method to get the player's move based on the current state of the chess board.
- Python 3.x
- chess library (install via pip)
This project is licensed under the MIT License.