Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
game_board_for_concepts.cpp
Go to the documentation of this file.
3#include <memory>
5#include <stdexcept>
7
8namespace gameboard {
9
10// //! Starting board represented as 2-D array of integers.
11// //! Can be converted to array of GamePiece objects by
12// //! board_utilities::int_board_to_game_pieces.
14 {5, 4, 3, 2, 1, 2, 3, 4, 5},
15 {0, 0, 0, 0, 0, 0, 0, 0, 0},
16 {0, 6, 0, 0, 0, 0, 0, 6, 0},
17 {7, 0, 7, 0, 7, 0, 7, 0, 7},
18 {0, 0, 0, 0, 0, 0, 0, 0, 0},
19 {0, 0, 0, 0, 0, 0, 0, 0, 0},
20 {-7, 0, -7, 0, -7, 0, -7, 0, -7},
21 {0, -6, 0, 0, 0, 0, 0, -6, 0},
22 {0, 0, 0, 0, 0, 0, 0, 0, 0},
23 {-5, -4, -3, -2, -1, -2, -3, -4, -5},
24}};
25
26// //! Max allowed repetitions of prohibited move sequence lengths.
27const int kRepeatPeriodsToCheck[3] = {2, 3, 4};
28
29// //! Repeated move sequence lengths forbidden under move repetition rules.
30// //! If kRepeatPeriodsToCheck = {2, 3, 4} and kRepeatPeriodsMaxAllowed = 2, then the
31// //! following sequences are probibited:
32// //! ABABAB, ABCABCABC, ABCDABCDABCD, ABCDEABCDEABCDE, ABCDEFABCDEFABCDEF
33const int kRepeatPeriodsMaxAllowed = 2;
34
35const int kMaxMovesWithoutCapture = 120;
36
37} // namespace gameboard
Constants, typedefs, and simple structs used by gameboard::GameBoard.
Tracking piece positions and determining legal moves.
const BoardMapInt_t kStandardInitialBoard
Starting board represented as 2-D array of integers.
array< array< int, kNumFiles >, kNumRanks > BoardMapInt_t
2-D array of integers; can be converted to gameboard::BoardMap_t using gameboard::int_board_to_game_p...
const int kRepeatPeriodsToCheck[3]
Max allowed repetitions of prohibited move sequence lengths.
const int kMaxMovesWithoutCapture
const int kRepeatPeriodsMaxAllowed
Repeated move sequence lengths forbidden under move repetition rules.
Definition of gameboard::PieceMoves and related constants.
Defiition of miscellaneous free functions (and implementation of those that are templates).