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;
You can unset an array element if you know its key. For example:
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.