Changes

Jump to: navigation, search

EXchess

441 bytes added, 14:48, 22 January 2019
no edit summary
=Board Representation=
EXchess utilizes an [[8x8 Board]] and [[Piece-Lists|piece lists]] as demonstrated in its [[Move Generation|move generation routine]] <ref>[http://personal.denison.edu/%7Ehomand/EXchess_files/EXchess_v5.01beta_source.tar.gz EXchess v5v7.01 97 beta source code], chess.h, moves.cpp</ref> :
<pre>
struct // Typedef for square {using unsigned 8 bits... char type; // -- first 3 bits for piece type of piece (0 - 6) char side; // -- next bit for side which owns square of piece (1 = white, 0 = black)}// See define.h for marcos and definitions to handle these typedef uint8_t square;
struct position {
square sq[64];
...
char uint8_t plist[2][7][10];
...
};
void position::allmoves(move_list *list, tree_search ts_thread_data *tstdata) { ... for(i=1;i<=plist[wtm][PAWN][0];i++) pawn_moves(list, plist[wtm][PAWN][i], ts); for(i=1;i<=plist[wtm][KNIGHT][0];i++) knight_moves(list, plist[wtm][KNIGHT][i], ts);
...
for(i=1;i<=plist[wtm][PAWN][0];i++)
pawn_moves(list, plist[wtm][PAWN][i], tdata);
for(i=1;i<=plist[wtm][KNIGHT][0];i++)
knight_moves(list, plist[wtm][KNIGHT][i], tdata);
for(i=1;i<=plist[wtm][BISHOP][0];i++)
bishop_moves(list, plist[wtm][BISHOP][i], tdata);
for(i=1;i<=plist[wtm][ROOK][0];i++)
rook_moves(list, plist[wtm][ROOK][i], tdata);
for(i=1;i<=plist[wtm][QUEEN][0];i++) {
bishop_moves(list, plist[wtm][QUEEN][i], tdata);
rook_moves(list, plist[wtm][QUEEN][i], tdata);
}
for(i=1;i<=plist[wtm][KING][0];i++)
king_moves(list, plist[wtm][KING][i], tdata);
}
</pre>

Navigation menu