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

@ Gerd Degens[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Thu, Feb 29 02:04 PM EST in reply to H. G. Muller from 02:54 AM:

If not, it seems to be useful to have an operator (let's call it number) that would evaluate to the numerical value of its operand, but to zero if the operand was not numeric, or undefined. So that I could write something like number elem #key piececount, which would give me the expected 0 if #key was not a valid key in the piececount table.

The int operator, which already exists, should do what you want. It uses the PHP function intval to convert its input to an integer, and for input that is not numeric, it will return 0.