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.1.tar.gz (35.1 kB view hashes)

Uploaded Source

Built Distribution

lexwolf-0.2.1-py3-none-any.whl (37.0 kB view hashes)

Uploaded Python 3

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