Check out Atomic Chess, our featured variant for November, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

how do you program a non-capture move[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Sat, Jul 20 05:14 PM UTC in reply to Daniel Zacharias from 02:55 PM:

No, this may work for potential moves, but it will not work for actual moves. I believe you should replace "empty where #0 0 -1" with "cond empty #0 capture empty #1". Also, the function would be better optimized for most legal moves, as well as for testing for check on the King, if you reversed its two parts. This will also allow you to use breaking logic all the way through.

def White_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 capture empty #1 or checkleap #0 #1 2 2;