The elephant to me is a diagonal mover. It may leap 1 or two squares. I want to make a variant of the elephant that has the ability to change its diagonal color (checkered board). The changing of color is a special move.
I think the original suggestions I gave were mistaken.
def White_Elephant checkaleap #0 #1 0 -1 and cond empty #0 capture empty #1 or checkleap #0 #1 2 2;
def White_Elephant checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1 or checkleap #0 #1 2 2 or checkleap #0 #1 1 1;
def Black_Elephant checkaleap #0 #1 0 1 and cond empty #0 capture empty #1 or checkleap #0 #1 2 2;
def Black_Elephant checkaleap #0 #1 0 1 and cond empty #0 not capture empty #1 or checkleap #0 #1 2 2 or checkleap #0 #1 1 1;
So each one first checks whether the move is a diagonal leap of one or two spaces. If it is not, it checks the condition "cond empty #0 not capture empty #1". If the origin space is empty, it is checking an actual move. So it checks whether a capture has already been made. If the origin space is not empty, it is checking a potential move. So it checks whether the destination space is still empty. If it turns out to be a capturing move, the function immediately returns false. Otherwise, it evaluates whether it is a one-space move vertically backwards.
I think the original suggestions I gave were mistaken.
def White_Elephant checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1 or checkleap #0 #1 2 2 or checkleap #0 #1 1 1;
def Black_Elephant checkaleap #0 #1 0 1 and cond empty #0 not capture empty #1 or checkleap #0 #1 2 2 or checkleap #0 #1 1 1;
So each one first checks whether the move is a diagonal leap of one or two spaces. If it is not, it checks the condition "cond empty #0 not capture empty #1". If the origin space is empty, it is checking an actual move. So it checks whether a capture has already been made. If the origin space is not empty, it is checking a potential move. So it checks whether the destination space is still empty. If it turns out to be a capturing move, the function immediately returns false. Otherwise, it evaluates whether it is a one-space move vertically backwards.