Skip to content

a1eaiactaest/chess-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess

Implementation of a chess engine based on Minimax with Alpha Beta Pruning.

Description

This is a chess engine implementation in Go that uses the Minimax algorithm with Alpha-Beta pruning for move calculation. It includes both a command-line interface and a web server component.

Prerequisites

Installation

  1. Clone the repository:
git clone <repository-url>
cd chess-engine
  1. Install dependencies:
go mod download

Usage

Command Line Interface

Run the engine with a specific FEN position:

go run main.go "your-fen-string"

If no FEN string is provided, it will use a default position.

Web Server

The engine also provides a web server interface that runs on port 2828.

  1. Start the server:
go run main.go
  1. Available endpoints:
  • GET / - Basic health check
  • POST /info - Calculate best move for a given position
    {
      "depth": 5,
      "fen": "your-fen-string"
    }
  • POST /analysis - Analyze chess positions (WIP)

Environment Variables

  • DEBUG: Set to any value to enable debug output

Features

  • Minimax algorithm with Alpha-Beta pruning
  • Iterative Deepening Search (IDS)
  • Position evaluation using piece values and piece-square tables
  • Web API for move calculation
  • Support for FEN position input

Project Structure

  • main.go - Entry point
  • engine/ - Core chess engine implementation
  • controller/ - Web server and API handlers
  • test/ - Test utilities

About

Chess engine based on Minimax with Alpha Beta Pruning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors