💡📝H. G. Muller wrote on Wed, Jul 22, 2020 05:57 AM UTC:
Would it be an idea to tick the checkbox and take charge of the parsing of the move ourselves? E.g. with code like:
set mvs explode chr 59 thismove;
set parts explode ws trim elem 0 mvs;
set i count mvs;
if > i 2:
die "move must be piece ID plus board step";
endif;
set sqrs explode chr 45 trim elem dec var i parts;
if != 2 count sqrs:
die "board step does not mention two squares";
endif;
set myorigin elem 0 sqrs;
set mydest elem 1 sqrs
if not onboard myorigin or not onboard mydest:
die "the board isn't that large";
endif;
set mymoved space myorigin;
if != mymoved elem 0 parts and == 1 i:
die join "there is no " elem 0 parts " at " myorigin;
endif;
This seems more efficient than storing and restoring the game state all the time to undo what the system does automatically. And it could also be extended to understand more elaborate move formats, like origin-ep-dest or even origin-ep1-ep2-dest for moves that make a locust captures on ep / ep1 / ep2. Of course we would have to make the move ourselves, at some point, (after the legality testing) by something like
Would it be an idea to tick the checkbox and take charge of the parsing of the move ourselves? E.g. with code like:
This seems more efficient than storing and restoring the game state all the time to undo what the system does automatically. And it could also be extended to understand more elaborate move formats, like origin-ep-dest or even origin-ep1-ep2-dest for moves that make a locust captures on ep / ep1 / ep2. Of course we would have to make the move ourselves, at some point, (after the legality testing) by something like