Check out Grant Acedrex, our featured variant for April, 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

The Fairychess Include File Tutorial. How to use the fairychess include file to program games for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Wed, Apr 1, 2020 02:14 PM UTC:

In your code, K1stmove just appears by itself, and it gets interpreted as a string literal that has no meaning. I expect it will always evaluate to true. So, your code should be logically equivalent to this:

def Apothecary_King or or checkleap #0 #1 2 1 checkleap #0 #1 1 0 checkleap #0 #1 1 1;

That should work for displaying Knight moves. So, I don't know why your code is not displaying Knight moves. But other things about it need to be fixed anyway.

Also, your logical operators are all at the beginning, which is wasteful. Learn to use them with single arguments so that you can break out of the function early when it already has the correct result, like this example does:

def Apothecary_King checkleap #0 #1 2 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 1;

Take a look at the Pawn functions for more complex examples of how to do this.