Upgrade ffish.js to 0.4.4 and add validate_fen
authorJohannes Czech <QueensGambit@users.noreply.github.com>
Wed, 21 Oct 2020 22:51:47 +0000 (00:51 +0200)
committerGitHub <noreply@github.com>
Wed, 21 Oct 2020 22:51:47 +0000 (00:51 +0200)
commit80c5dd4d1d9b72c19f1dfc09b7482374020b3619
treeaeb61121e44859567ba132ba8a2f058a25ed4ac2
parent59a4237db3f99cf3faa0821893859bc0de320ddf
Upgrade ffish.js to 0.4.4 and add validate_fen

* Upgraded ffish.js to 0.4.4
+ validate_fen(const std::string& fen, const Variant* v) (Closes #87)
+ ffish.validate_fen(fen)
+ ffish.validate_fen(fen, uciVariant)
+ ffish.startingFen(uciVariant)
+ board.pocket(turn)

Refactoring
+ replaced bool first = true by save_pop_back(string& s)
+ replaced string = " " + s; by string += " "; string += s;

updated README.md
+ simplified memory specification

* Added C++17 specification for building ffish.js
+ updated ffish.js to 0.4.4

* Added more checks to validate_fen()
+ FEN_TOUCHING_KINGS
+ replaced FEN_INVALID_CHECK_COUNTER by FEN_INVALID_NUMBER_OF_KINGS
+ combined FEN_FILE_SIZE_MISMATCH and FEN_INVALID_NUMBER_OF_RANKS into
FEN_INVALID_BOARD_GEOMETRY
+ added more checks for FEN_INVALID_CASTLING_INFO

added struct CharSquare
added class CharBoard (for geometry checks)
refactored different checks into separate functions
src/apiutil.h
src/ffishjs.cpp
src/variant.cpp
src/variants.ini
tests/js/README.md
tests/js/package.json
tests/js/test.js