Check out Modern Chess, our featured variant for January, 2025.


[ 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

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Tue, Mar 10, 2020 06:30 PM UTC:

I was recently thinking about how to do a Chameleon piece with the new fairychess include file, though I haven't done anything yet. Here's what could work. Use a global variable to keep track of the last piece moved by the previous player. For example, put "set lastpiece $moved;" at the end of the Post-Move sections. Then define the piece like so:

def Joker fn const alias #lastpiece #0 #1;
def Joker-Range fn join const alias #lastpiece "-Range" #0;
If you're not using aliases for any pieces, you can omit the "alias" keyword. For earlier include files, the principle would be the same, but the code would be different.