Check out Symmetric Chess, our featured variant for March, 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 Sat, Mar 12, 2022 03:37 AM UTC:

I have added the following built-in functions: chars, string, hasalnum, hasalpha, hasdigit, haslower, and hasupper. The chars and string functions can be used together to process a string with a lambda function filter, using chars to turn a string into an array of characters, and using string to converted the processed array back into a string. For example, promoted pieces in Shogi put a plus sign before the usual piece label, and the boldfaced part of this line demotes a piece in Shogi by removing any non-alphabetic characters:

set demoted flipcase realname string filter lambda (isalpha #1) chars alias space $dest;

The has functions are similar to isalnum, isalpha, isdigit, islower, and isupper, but instead of checking whether every character in a string is of a particular type, these check whether any character, even just one, is of a particular type. These come in handy when piece labels include non-alphabetic characters, as promoted pieces do in Shogi.