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 History. History of the Chess Variants Game Courier PBM system.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Sat, Jul 25, 2020 10:38 PM UTC:

I have completed some improvements in how arrays are handled. Elements of multi-dimensional arrays may now be specified by including periods in the variable name. Each period separates an array element from its parent array. For example, in #example.element, the parent array comes first, and the element comes second. Deep multi-dimensional arrays are also possible, such as #this.is.an.example.of.a.deep.multidimensional.array.element. You can now set array elements with set, and you can use the value of array elements as arguments to commands that do not evaluate expressions.

You can also use array elements with some commands that change their value. For example, if you kept track of captured pieces in an array called cp, inc cp.p would increment the number of captured Black Pawns.

You can also read the values of elements in system arrays, such as $originalpieces.p, which would return 8 in Chess.

You can also insert variables into array element names using {}. For example, the code below would increment the element of cp corresponding to the captured piece whenever a piece is captured.

if capture:
  inc cp.{$old};
endif;

The setelem command still works, but now it just concatenates the array name with the element name and calls setuservar(). Likewise, the elem operator still works, but when an array is given by variable name, it will concatenate the names and call getuservar();