Table of Contents
A full stack chess app using PyQt5 for the front end and an engine using Monte-Carlo Algorithms. This project is designed to meet the AQA Computer Science A Level specification.
chess_board_1.py
: Contains theChessBoard
class which initializes the chessboard and sets up the pieces.postgres_auth.py
: Handles database connections and user authentication.postgresql_auth.py
: Handle user login connections.eval_board.py
: Evaluates the board state.gui.py
: Manages the graphical user interface.hsm.py
: Hierarchical state machine implementation.mcts.py
: Monte Carlo Tree Search implementation.pgn_to_db.py
: Converts PGN files to database entries.pieces.py
: Defines the chess pieces (Bishop, King, Knight, Pawn, Queen, Rook).promotion_window.py
: Manages the promotion window for pawns.split_file.py
: Utility to split files.train.py
: Training script for AI.
Python versions 3.9 - 3.12 are supported. You can download the latest version of python from here
Clone the github repo by running
git clone https://github.com/arozx/a_level_project.git
Install the required packages by running
pip install -r requirements.txt
To run the program use the following comand
python chess_board_1.py
To run with a client and server run the following command on the server:
uvicorn main:app --reload --port 8000
gunicorn -w 2 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 main:app
And the following command on the client (You may need to pass a URI as an argument if you are using your own server):
python3 -m client.py
To run the tests, first install tox by running (PyTest is a dependancy and will be installed automatically with tox)
pip install tox
Then run the tests by running
tox
Images used in this project are from Wikimedia Commons. The images are under the Creative Commons license. Please see the individual image pages for more information on the copyright holder and the specific license conditions.