Check out Glinski's Hexagonal Chess, our featured variant for May, 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

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 Wed, Nov 25, 2009 03:25 AM UTC:
I have just added support for function literals. I'll be brief, because now I'm tired.

The literal operator returns a function literal or an array literal, depending on whether it receives a function name or an array.

The setfn command sets the named function to the value of an expression. To copy a function, you can set a new function to the literal of an already defined function. For example:

def ff - #0 #1;
setfn qq literal ff;

This also works:

def ff - #0 #1;
set dd literal ff;
eval def qq #dd;

You can copy functions even faster without the intermediary of function literals:

copyfn ff qq;

With function literals, you can write code that creates its own functions. This may be useful for writing more generalized code, which can be used with more games, or for games whose rules change according to new conditions.