Skip to content

arozx/chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Chess app

Bishop

A Python bot that plays chess against you
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Testing
  5. Licence

About The Project

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 the ChessBoard 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.

(back to top)

Getting Started

Prerequisites

Python versions 3.9 - 3.12 are supported. You can download the latest version of python from here

Installation

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

(back to top)

Usage

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:

Dev:

uvicorn main:app --reload --port 8000

Production:

gunicorn -w 2 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 main:app

Client:

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

Testing

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

License

Images

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.

(back to top)

About

Chess engine implamented using Monte Carlo with a PyQt GUI

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •