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 Fri, Nov 28, 2008 07:27 PM EST:

Thanks for your interest in GAME Code.

1. I've had the same problem, but I haven't taken the time to look into it. Maybe I will sometime.

2. Fixing a preset people are using should normally have no harmful effect on any ongoing games. It might break some logs if someone has made an illegal move and your bugfix corrects this. I can fix logs manually when this happens. Adding the ability to spot check, checkmate and stalemate is unlikely to break any logs unless someone continued a game past its natural end.

3. While there is no defined behavior, tests indicate that when the stack does not have all the operands required by an operator, the operator gets null values for the remaining operators. For example, '+ 1' returns 1, '* 1' returns 0, '- 1' returns 1, and '/ 1' complains of a division by zero error and returns nothing.

If there are more values on the stack after evaluating an expression, the expression will return a backwards array of all the values remaining in the stack. For example, set a + 5 6 - 8 3 sets a to the array (5 11). To get an array in the same order as the remaining operands, use the array operator, as in set a array + 5 6 - 8 3, which sets a to the array (11 5). Sub-expressions within a larger expression will use only as much of the stack as they need and return values to be used in the larger expression. For example: set a * + 5 6 - 8 3 would reduce to set a * + 5 6 5 then to set a * 11 5 and finally to set a 55.

Since GAME Code is loosely typed, it will convert a value given as one type to the type of value it is using. For example, a boolean value of false would be treated as zero by a math operator. In your example, 'where #ep 0 1' where ep is set to false, it apparently got interpreted as a1, whose index in the list of coordinates is zero. It is normally expected that you will write your code to give operators the types of operators they expect, and the results you may get from bad data are undefined.

4. The notation for coordinates and pieces are strings. In Game Courier, the board is represented by an array whose keys are coordinates and whose values are pieces, @ signs for empty space, and - signs for offboard locations. This array is called $space, and GAME Code lets you read the contents of its elements with the space operator.