Library for running chess simulations. Allows customizable AI including random choice and minimax (with variable depth).
Install with pip
$pip install ChessGame
Or clone repo using git.
$git clone https://github.com/pelletier2017/ChessGame.git
Example Usage with 2 players
import chess.player as player
from chess.game import ChessGame
p1 = player.Player()
p2 = player.Player()
# setup game
game = ChessGame(p1, p2, first_move=1)
# useful attributes
curr_player = game.player_turn
player1_pieces = game.p1_pieces
player2_pieces = game.p2_pieces
all_pieces = game.pieces
moves = game.possible_moves
# performs moves in game
game.do_move("b2 b4")
p2_moves = game.possible_moves
game.do_move("c7 c6")
Example with two AI players
import chess.player as player
from chess.game import ChessGame
p1 = player.RandomComputer()
p2 = player.BasicMinimax()
game = ChessGame(p1, p2)
game.play()
Dependencies are found in requirements.txt
$pip install -r requirements.txt
Tests are discovered using tox. It will take a while the first time to build virtual envs to run tests.
$tox
Travis CI will run tests automatically when changes are pushed to github.
travis-ci.org/pelletier2017/ChessGame
Landscape evaluates code quality including code style. Project goal is to stay above 95%.
landscape.io/github/pelletier2017/ChessGame
Coveralls evaluates code coverage. Project goal is to stay above 80%.
coveralls.io/github/pelletier2017/ChessGame
Contributing guide coming later.
This project is licensed under the MIT License - see the LICENSE.md file for details