Git Product home page Git Product logo

danthurston / beatmychessai Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 12.07 MB

A multi-algorithm chess game that aims to teach AI concepts through experimentation. Users can select from four algorithms to compete against, as well set the search depth.

License: GNU General Public License v3.0

Python 100.00%
chess python ai-games ai-search-algorithms minimax-algorithm minimax-alpha-beta-pruning mtdf quiescence-search chess-engine chess-ai

beatmychessai's Introduction

BeatMyChessAI

Main Computing Project. By Daniel Thurston.

This software provides a platform to compete against four different AI chess algorithms: NegaMax, NegaMax with Alpha-Beta Pruning, NegaScout with Quiescent Search, and MTD(f). It comes with a GUI with various statistical outputs such as timers and move-history, as well as functionality to highlight potential moves for any selected chess piece.

The software has a goal of teaching AI concepts through the medium of chess by allowing users to adjust the search depth and experiment between algorithms.

main:

Imports '.bin' opening book file then calls gui.

gui:

I/O and handling of the gui creation and handling.

concreteGUI:

Creates the concrete layout of the application.

game:

Handles the gameplay of the software, acting as a bridge between the algorithms and the gui.

book:

Handler for the 'opening_book.bin' file. Called before the engine to check if board state correlates with pre-defined states for opening moves.

moves:

Move Generator. This is used solely for highlighting moves on-click. It generates lists of legal squares for any clicked piece and returns it to the gui to highlight.

timer:

Handles the creation and definitions of the timers. three timers are used, one for counting each move duration, total time, and remaining time, respectively.

NegaMax, NegaMaxAB, and NegaScout:

The code for each respective algorithm.

MTDf:

MTD(f) algorithm. It has sole use of 't_table.py' and 'evaluator.py'.

piece_tables:

Define a score for each position on the board, for each piece.

evaluator:

Utility evaluation function. Scores nodes of the search tree when called. Scores are based on positions (piece_tables) and values of the pieces. (I need to make this evaluation more substantial (eg killer heuristic and history heuristic)).

t_table:

Transposition Table file. This contains two classes, one for the main table itself, and one for each entry. TTables store moves throughout the game to avoid re-calculating the same states. It is implemented through a Zobrist Hash calculated by the Python Chess library.

piece_tables:

This was the original set of table definitions used before switching to MTD(f) method. They are much more logical, promote castling, knight centralization etc. piece_tables3 contains much more confusing tables that appear to have no logic. I replaced the init. tables with the ones from this file but have the original tables stored. Understanding how these tables relate is probably key.

beatmychessai's People

Contributors

danthurston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.