Partially fix #195: Error: Invalid Move: (none)

1. Initial movePriorityList
2. Add await to send(getPositionFen(position!)); and await send('go');

See: https://github.com/calcitem/Sanmill/issues/195
This commit is contained in:
Calcitem 2021-05-15 22:47:16 +08:00
parent 2a7a3de858
commit 443c08b256
2 changed files with 8 additions and 3 deletions

View File

@ -94,7 +94,12 @@ struct MoveList
static void create();
static void shuffle();
inline static std::array<Square, EFFECTIVE_SQUARE_NB> movePriorityList {SQ_NONE};
inline static std::array<Square, EFFECTIVE_SQUARE_NB> movePriorityList {
SQ_16, SQ_18, SQ_20, SQ_22 ,
SQ_24, SQ_26, SQ_28, SQ_30, SQ_8, SQ_10, SQ_12, SQ_14 ,
SQ_17, SQ_19, SQ_21, SQ_23,
SQ_25, SQ_27, SQ_29, SQ_31, SQ_9, SQ_11, SQ_13, SQ_15
};
inline static Square adjacentSquares[SQUARE_NB][MD_NB] = { {SQ_NONE} };
inline static Bitboard adjacentSquaresBB[SQUARE_NB] = { 0 };

View File

@ -58,8 +58,8 @@ class NativeEngine extends Engine {
Future<EngineResponse> search(Position? position) async {
if (await isThinking()) await stopSearching();
send(getPositionFen(position!));
send('go');
await send(getPositionFen(position!));
await send('go');
final response = await waitResponse(['bestmove', 'nobestmove']);