Authored by: Hou GuoChen Gary
The project folder is structured as follows:
chess
__init__.py
constants.py
games.py
main.py
pieces.py
player.py
README.md
utility.py
constants.py: global constants used for the project
games.py: game class controller that controls the process of the game.
main.py: main method that defines the iteraction with user on command line input.
pieces.py: chess piece classes that models typical chess pieces.
player.py: defines the player and A! class
README.md: (this file) instructions for interacting with the program
utility.py: custom utility functions used by modules.
The solution supports interaction via stdin in the command line interface. Note: Game requires system support for ANSI color code in order to play.
-
Navigate to project level folder
../path/to/chess
-
In command line interface, type the following to start game:
$ python main.py
-
You should see the following welcome message:
Welcome to chess! Select a game type: 1. AI vs. AI 2. Human vs. AI 3. Human vs. Human Select game mode::
-
Input
1
to watch 2 AI players play chess against each other. -
Input
2
to play against AI player. -
Input
3
to play against another player. -
Game mode ending with different possible outcomes would result in the following outputs:
DRAW
Draw with 50 idle moves
STALEMATE
Stalemated!
WHITE WIN
Checkmated! White wins!
BLACK WIN
Checkmated! Black wins!