?? board.h
字號:
// board.h
#ifndef BOARD_H
#define BOARD_H
// includes
#include "piece.h"
#include "square.h"
// macros
#define KING_POS(board,color) ((board)->piece[color][0])
// types
struct board_t
{
int piece_material[2];
int square[256];
int pos[256];
sq_t piece[2][32]; // only 17 are needed
int piece_size[2];
sq_t pawn[2][16]; // only 9 are needed
int pawn_size[2];
int piece_nb;
int number[16]; // only 12 are needed
int pawn_file[2][16];
int turn;
int flags;
int ep_square;
int ply_nb;
int sp; // TODO: MOVE ME?
int cap_sq;
int moving_piece;
int opening;
int endgame;
uint64 key;
uint64 pawn_key;
uint64 material_key;
uint64 stack[4096];
};
// functions
extern bool board_is_ok(const board_t *board);
extern void board_clear(board_t *board);
extern void board_copy(board_t *dst, const board_t *src);
extern void board_init_list(board_t *board);
extern bool board_is_legal(const board_t *board);
extern bool board_is_check(const board_t *board);
extern bool board_is_mate(const board_t *board);
extern bool board_is_stalemate(board_t *board);
extern bool board_is_repetition(const board_t *board);
extern int board_material(const board_t *board);
extern int board_opening(const board_t *board);
extern int board_endgame(const board_t *board);
#endif // !defined BOARD_H
// end of board.h
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -