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

The birth of 3 new variants - part 2 : Grand Apothecary Chess Modern[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Wed, Jul 21, 2021 05:19 PM UTC in reply to Aurelian Florea from Tue Jul 20 01:38 PM:

I still need to understand how to delete a value from an array in order to remove the necessary value from wcastle or bcastle.

You can unset an array element if you know its key. For example:

set ra array a b c d e f g h i j k l m n o p q r;
unset ra.4; // removes e from array

But what if you just know the element you want to delete and not its key? I have now added a diff operator to return an array difference. When an argument isn't already an array, it gets turned into a single element array. So, this code removes j1 from wcastle.

set wcastle d1 c1 j1 k1;
set wcastle diff #wcastle j1;