Skip to content

v1.8

Choose a tag to compare

@thewizardplusplus thewizardplusplus released this 06 Mar 19:09
· 53 commits to master since this release

Adding the chessmodels.SliceBoard structure; optimization.

Change Log

  • new features:
    • the chessmodels.BaseBoard structure that stores a board size;
    • the chessmodels.SliceBoard structure:
      • rename the chessmodels.Board structure to chessmodels.MapBoard;
      • add the chessmodels.SliceBoard structure;
      • add the chessmodels.SliceBoard structure to the go-chess-perft tool;
      • make the chessmodels.Board type redirect to the chessmodels.SliceBoard structure;
    • transform the Pieces() methods of the chessmodels.MapBoard and chessmodels.SliceBoard structures to an independent function;
    • the chessmodels.Size structure:
      • add the PositionIndex() method;
      • add the PositionCount() method;
      • add the IteratePositions() method;
  • refactoring:
    • optimize memory allocations;
  • unit testing:
    • slightly improve the tests of the chessmodels.MapBoard structure:
      • of the Piece() method;
      • of the ApplyMove() method;
    • add the benchmarks based on the chessmodels.Perft() function:
      • for the chessmodels.MapBoard structure;
      • for the chessmodels.SliceBoard structure.

Features

  • representing the board:
    • as an associative array of pieces with their positions as keys;
    • as a plain array of pieces with exact correspondence array indices to piece positions;
  • immutable applicating moves to the board via copying the latter;
  • checkings of moves:
    • universal;
    • individual for all types of pieces;
  • generating moves via filtering from all possible ones;
  • perft function;
  • using an abstraction of a piece;
  • Forsyth–Edwards Notation:
    • parsing:
      • of a position;
      • of a move;
      • of a piece kind;
      • of a piece color;
      • of a board;
    • serialization:
      • of a position;
      • of a move;
      • of a piece kind;
      • of a piece color;
      • of a board;
  • utilities:
    • utility for counting all possible moves (based on the perft function).