Giter Site home page Giter Site logo

chesslib's Introduction

ChessLib

A C# chess data library with complete move generation and all needed custom types.

Build status

Requirements

  • .NET Core 3.1+

What is this for?

This library contains all the data, types and structures for which to create a piece of chess software. It does not contain any heuristics or search algorithms as these are meant to be implemented separately.

But why?

This library was developed during a course "Advanced C# and object oriented programming E17" at DTU (Danish Technical University) as part of a chess user interface, which will be released at a later stage when it is ready. Since the UI needs to handle legality, mate check etc etc, all these features are contained within the library.

Can i use this as a starting point for my chess software?

Yes you can, it is designed with that in mind.

Features

  • Custom perft application which uses the library to calculate and compare results from custom positions
  • Transposition Table
  • Complete move generation with legality check
  • Custom compact and very efficient types for Bitboard, Square, Piece, Move, Player, File, Rank and Direction with tons of operators and helper functionality
  • 100% Bitboard support with piece attacks for all types, including lots of helper functions
  • Lots of pre-calculated bitboard arrays to aid in the creation of an evaluation functionality
  • FEN handling with optional legality check
  • Magic bitboard implementation Copyright (C) 2007 Pradyumna Kannan. Converted to C#
  • FEN input and output supported
  • Chess960 support
  • Zobrist key support
  • Basic UCI structure
  • HiRes timer
  • Draw by repetition detection
  • Mate validation
  • Plenty of unit tests to see how it works
  • Notation generation for the following notation types: Fan, San, Lan, Ran, Uci
  • Benchmark project for perft
  • Custom MoveList data structure
  • Pawn blockage algorithm

Is it fast?

Yes. As far as C# goes it should be able to hold its own.

Perft console test program approximate timings to depth 6

  • AMD-FX 8350 = ~12.5 seconds. (without TT) (earlier version)
  • Intel i7-8086k = ~4 seconds

What is not included?

  • Evaluation
  • Search
  • Communication using e.i. UCI (base parameter struct supplied though)

Planned

  • Basic chess engine (search + evaluation) w. UCI support
  • As nuget package

chesslib's People

Contributors

jongleur1983 avatar rudzen 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.