I have made the distinction between the function and the subroutine. But I still could not make work as expected.
def Apothecary_King
checkleap #0 #1 1 3
or checkleap #0 #1 1 2
and not sub checked #0
and match rankname #1 1 10
and flag #0
or checkleap #0 #1 1 0
or checkleap #0 #1 1 1;
sub Apothecary_King from to:
if checkleap #from #to 1 1 or checkleap #from #to 1 0:
return true;
endif;
move #to #from;
if checkleap #from #to 1 3
or checkleap #from #to 1 2
and match rankname #to 1 10
and flag #from :
if sub checked #from:
die You may not perform the special moves out of check.;
endif;
else:
move #from #to;
return true;
endif;
endsub;
I have made the distinction between the function and the subroutine. But I still could not make work as expected.
def Apothecary_King
checkleap #0 #1 1 3
or checkleap #0 #1 1 2
and not sub checked #0
and match rankname #1 1 10
and flag #0
or checkleap #0 #1 1 0
or checkleap #0 #1 1 1;
sub Apothecary_King from to:
if checkleap #from #to 1 1 or checkleap #from #to 1 0:
return true;
endif;
move #to #from;
if checkleap #from #to 1 3
or checkleap #from #to 1 2
and match rankname #to 1 10
and flag #from :
if sub checked #from:
die You may not perform the special moves out of check.;
endif;
else:
move #from #to;
return true;
endif;
endsub;