bpaul-chess

UCI chess engine to replace Omelette Chess Engine
Log | Files | Refs | README | LICENSE

commit de846c8041fe1d7824611dc1dbcaebafa64619fb
parent e5ed60ce30c0011362b38b1830808d3416be4d32
Author: benjamin paul <bpaul@bpaul.xyz>
Date:   Sat, 11 Sep 2021 16:17:10 +1000

get rid of bitmasks because they are not portable apparently and also move source to one directory

Diffstat:
Rsrc/board/bb.h -> src/bb.h | 0
Dsrc/board/pos.h | 30------------------------------
Asrc/pos.h | 21+++++++++++++++++++++
3 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/src/board/bb.h b/src/bb.h diff --git a/src/board/pos.h b/src/board/pos.h @@ -1,30 +0,0 @@ -#pragma once - -#include "bb.h" - -enum sides { WHITE, BLACK, SIDE_CNT }; - -enum pieces { PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING, PIECE_CNT }; - -struct pos { - bb sides[SIDE_CNT]; - bb pieces[PIECE_CNT]; - - /* Only need one bit, either white or black */ - char turn : 1; - - /* Each bit represents one of the castling rules, a bit for whether white - * can kingside castle, one for queenside castling, and a bit for black for - * each too */ - char castle : 4; - - /* enpas refers to the square that a double pushed pawn moves to. Since - * there are 64 squares, 6 bits are needed */ - char enpas : 6; - - /* Tracker for 50 move rule */ - unsigned char fifty; - - /* Track game length (hence the name) */ - unsigned short game_length; -}; diff --git a/src/pos.h b/src/pos.h @@ -0,0 +1,21 @@ +#pragma once + +#include "bb.h" + +enum sides { WHITE, BLACK, SIDE_CNT }; + +enum pieces { PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING, PIECE_CNT }; + +struct pos { + bb sides[SIDE_CNT]; + bb pieces[PIECE_CNT]; + /* Castling permissions flags */ + char castle; + /* En passant square */ + char enpas; + /* Tracker for 50 move rule */ + unsigned char fifty; + /* Track game length (hence the name) */ + unsigned short game_length; + char turn; +};