The LexWolf chess artificial intelligences.
Project description
LexWolf Chess Library
Created by Loup François and Alexandre Le Mercier
Duration: February to May 2024
Note: IT IS HIGHLY RECOMMENDED TO USE THIS LIBRARY IN A NOTEBOOK ENVIRONMENT!
Overview
The LexWolf Chess Library provides a comprehensive toolkit designed to manage and evaluate chess games through the use of advanced algorithms and robust data structures. It integrates visualization tools, evaluation mechanisms, and AI-driven decision making, leveraging the capabilities of the widely-used python-chess
package. This library implements efficient game state representation and manipulation techniques, such as bitboards, and uses databases of opening strategies to enhance game play from the start. It is crafted for educational purposes and as a robust backend for developing more sophisticated chess-related applications.
Table of Contents
-
bitBoard
Manages the bitboard representation of the chess board, utilizing bits to denote the presence and state of pieces. Includes methods for evaluation and move generation based on the current board state. -
structEl
Provides structural elements for chess board representation, managing various board configurations and piece movements using matrix representations. -
LexWolfCore
Serves as the base class for implementing various chess algorithms, with utilities for evaluating board states and generating moves. It provides a framework for extending AI capabilities. -
DummyLexWolf
A basic AI implementation that selects moves randomly. It acts as a baseline or placeholder AI. -
MinmaxLexWolf
Implements the Minimax algorithm specifically tailored for chess, including optimizations like alpha-beta pruning to efficiently search the game tree. -
AdaptativeMinmaxLexWolf
An enhanced version of the Minimax AI that utilizes a database of popular and efficient opening strategies to optimize early-game moves. -
Game
Manages a chess game between two players, which can be either human or AI-driven. This class handles game setup, move validation, game state updates, and determining game outcomes according to chess rules.
Usage
To utilize this library, instantiate game objects, AI players, and manage game states as needed. The library supports both interactive and automated game sessions, providing flexibility for different user interactions and testing scenarios.
Example of initializing a game:
from lexwolf import *
game = Game(True, False, _, AdaptativeMinmaxLexWolf(max_depth=3))
This line configures a game with a human player as White and an AI using the adaptative model with depth 3 as Black.
Dependencies
- python-chess: For chess board management and legal move generation.
- numpy: For efficient numerical operations, particularly for board state evaluations.
- pandas: For managing opening book datasets.
- IPython: For displaying the boards visually in a notebook.
- time, random, math, os: Standard Python libraries utilized for various functional and operational purposes.
Installation
To install the LexWolf Chess Library, ensure that you have Python installed on your system, and run the following command in your terminal:
pip install lexwolf
Ensure all dependencies are also installed using pip if they are not already present in your environment.
Contributing
Contributions to the LexWolf Chess Library are welcome! Please fork the repository and submit a pull request with your proposed changes. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lexwolf-0.2.1.tar.gz
.
File metadata
- Download URL: lexwolf-0.2.1.tar.gz
- Upload date:
- Size: 35.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f0b4eabc28ae661abc722ddc5acc31179ea33788f9c489f0895b7ea6d4e8cb7 |
|
MD5 | 3d396182b8ab898c22dd5379281e5da8 |
|
BLAKE2b-256 | fd80be192918b8de776f9ab3305adfedbf0d6326881e95bd2b31d792e4f431fa |
File details
Details for the file lexwolf-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: lexwolf-0.2.1-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c9c095df3dff2c8f954948c93de1065daca2513f1c535429f10854fd6f55f78 |
|
MD5 | 1f57a50aa6e8d1c9326f125ad038dca1 |
|
BLAKE2b-256 | 3dd128688b477118fbc8bb835df4efd46483a35490a5498bae6db6da5567b3b5 |