H. G. Muller wrote on Tue, Oct 3, 2023 06:28 AM UTC:
You should make sure vic2 has a value; that of victim is set in the HandleMove code. Immediately after that you can copy it to vic2 by
set vic2 #victim
There then is no need to use #victim for succession of the Queen; it would do exactly the same as the code that used #vic2.
That reminds me of a flaw in the code; Prince, Princess need not be present. (And certainly would not be the second time, when you attempt it twice!) The search command would then return an invalid location, which would probably crash the following add command. So the add should only be executed if search found the piece, by replacing it with
if #p:
add k #p;
endif;
The Helepolis moves are described in the Pre-Game section like this (but very many more):
4 99 -1 0 2
99 -1 0 2
99 -1 0 2
99 -1 0 3
5 99 1 0 2
99 1 0 2
99 1 0 2
99 1 0 2
99 1 0 3
where the number in the first 'column' indicates the number of legs, and the last number the allowed occupancy of the final square of each leg. The 2 there means it has to end in a capture, but since the generic code can handle only one such leg (and here they would run up to 14), you would have to replace the 2 everywhere by 16 (which means that it should end on the mount of a hop). The 3 in the final leg you can leave (it means capture or move to empty).
You should make sure vic2 has a value; that of victim is set in the HandleMove code. Immediately after that you can copy it to vic2 by
There then is no need to use #victim for succession of the Queen; it would do exactly the same as the code that used #vic2.
That reminds me of a flaw in the code; Prince, Princess need not be present. (And certainly would not be the second time, when you attempt it twice!) The search command would then return an invalid location, which would probably crash the following add command. So the add should only be executed if search found the piece, by replacing it with
The Helepolis moves are described in the Pre-Game section like this (but very many more):