Skip to content

EliasKramer/Chess-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Chess Engine

I tried to program chess in c# before, but the program was terrible.
So i started programming in c++ and made chess.

Version 1:

This is my first project in c++.

I would call it "the normal approach". You start with a 8x8 array of pieces and work from there.
The Problem with this solution is, that it is really slow.

I learned a lot in this first try, but it has some issues.
So i made a minimum viable product (MVP) and started again.

It has no concept of checkmating, but that can be implemented easily in the future.
(Now implemented in V2)

Version 2:

I did a lot of research on the chess programming wiki and looked into some chess repos.
Research:

Then I started V2 with some major changes:

  • bitboards
  • fen-string setup implementation

Bitboards are basically a 64 bit number (unsigned long long), that can be used to represent a board of 0s and 1s.
You can now use bitwise operations like '&', '|' or '^' to combine different bitboards.
There is a really nice tool online to visiualize these boards: https://tearth.dev/bitboard-viewer/

A Fen String represents a board, so you can set up a testing position with only one short string.
Description: https://www.chess.com/terms/fen-chess
Set up a board: https://www.chess.com/analysis

V2 has 3 possible Players right now:

  • HumanPlayer (A Player that plays with console input)
  • RandomPlayer (A Player that picks its moves randomly)
  • Medicrius (Work in Progress. A Chess Algorithm, that finds some reasonably good moves)

Future:

Adding an algorithm, that can actually win chess.

About

Chess Engines. See https://github.com/EliasKramer/Leonardo for the current Engine in Development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published