Skip to main content

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

  1. 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.

  2. structEl
    Provides structural elements for chess board representation, managing various board configurations and piece movements using matrix representations.

  3. 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.

  4. DummyLexWolf
    A basic AI implementation that selects moves randomly. It acts as a baseline or placeholder AI.

  5. MinmaxLexWolf
    Implements the Minimax algorithm specifically tailored for chess, including optimizations like alpha-beta pruning to efficiently search the game tree.

  6. AdaptativeMinmaxLexWolf
    An enhanced version of the Minimax AI that utilizes a database of popular and efficient opening strategies to optimize early-game moves.

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

lexwolf-0.2.3.tar.gz (64.3 kB view details)

Uploaded Source

Built Distribution

lexwolf-0.2.3-py3-none-any.whl (66.6 kB view details)

Uploaded Python 3

File details

Details for the file lexwolf-0.2.3.tar.gz.

File metadata

  • Download URL: lexwolf-0.2.3.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for lexwolf-0.2.3.tar.gz
Algorithm Hash digest
SHA256 01eacff4021657d084533c1eee1fdc9bcddfa7df0de234e9e12b9cb0626c3f6c
MD5 22c30a12c6c6347b5ba85f61d71ec323
BLAKE2b-256 ac2475d11437084144272411885f61a0a875789893402e366318bcb16248838c

See more details on using hashes here.

File details

Details for the file lexwolf-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: lexwolf-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 66.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for lexwolf-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c2e6540180c97b095482d1af7b19c950788725e29a270a0673271d8b837ffea
MD5 53c0eff899030b5b8afb065cdbee5d8b
BLAKE2b-256 fd61e662fa2a7a5f18e3a970bd8095af43b7f04a1f4fef60222716cea7eac8b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page