B0-B / chess-engine

Chess engine implementation in C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chess-engine

Chess engine implementation in C++.

Pre-Requisites

sudo apt-get upgrade
sudo apt-get update
sudo apt install build-essential
sudo apt-get install g++-12 -y

logic

flowchart TD
    id1[determine white king scopes];
    id2[compute targets and moves];
    id3[move];
    id4[init];
    id5[update];
    id4 --> id2;
    id1 --> id2 --> id3 --> id5 --> id1;

improvements

board
  • King Screening
    Scopers can screen through opponent king, which turns all squares along the line-of-sight into targets. This makes sure that the king will move away from the LoS. Otherwise the king could capture a piece or just escape onto the square behind him if its no target.
  • Reserved Pointers
    Vectors of constant "max" size with reserved space reduce re-allocations in memory when new vectors are defined or overriden. Otherwise this can lead to a "double free()" error. Less allocations are increasing the update speed.

Profiling

Utilize gprof for profiling.

About

Chess engine implementation in C++.


Languages

Language:C++ 99.4%Language:Batchfile 0.4%Language:Shell 0.2%