Check out Janggi (Korean Chess), our featured variant for December, 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 Tue, Dec 21, 2004 05:08 AM UTC:
Control structure commands that introduce a body of code can now be ended
with a colon instead of a semicolon. These include if, elseif, else, do,
for, foreach, switch, case, and default. I did this, because I think it
looks better. In other languages that end lines with semicolons, these
commands normally do not end with semicolons. Semicolons are still allowed
for backwards compatibility with old code. The program code is now broken
up with a specialized parsing function instead of exploding on
semicolons.

The foreach command is now an alias for the for command. Both commands
work much like foreach from Perl or PHP. By using an array instead of a
string for naming the for variable, you can get both the key and the value
of each array member. For example, the following code lists all the spaces
of the board, assuming the 64-times limit of echo isn't exceeded:

foreach (key val) spaces:
  echo #key #val;
next;