🕸Fergus Duniho wrote on Sat, May 23, 2020 04:05 PM UTC:
First of all, you want to keep track of the last type of piece moved, and to start off with, it needs an initial default value.
set last_type_moved None;
def None false;
I'm thinking this could work for tracking the last piece moved:
if != const alias $moved Joker:
set last_type_moved const alias $moved;
endif
This keeps track of the last piece moved using its codename, which matches the function name used for how it moves. But now I have another question. Suppose that the last piece moved was a Black Pawn. Would the White Joker be able to move as a Black Pawn or as a White Pawn?
First of all, you want to keep track of the last type of piece moved, and to start off with, it needs an initial default value.
I'm thinking this could work for tracking the last piece moved:
This keeps track of the last piece moved using its codename, which matches the function name used for how it moves. But now I have another question. Suppose that the last piece moved was a Black Pawn. Would the White Joker be able to move as a Black Pawn or as a White Pawn?