H. G. Muller wrote on Fri, Aug 7, 2020 03:38 PM UTC:
Is there a GAME code command for setting the board to a given FEN code? I am currently looking into the issue of handling shuffle games. But because potentially every square on the board could be involved in a shuffle, it seems a good idea to store the entire board in a constant, like setconst startshuffle fencode; . The trick is to set up the board from the retreived constant, if that existed.
[Edit] Or would it be better to copy and restore the $space system variable, though
setconst startshuffle $space;
setsystem space const startshuffle;
?
[Edit2] Well, the latter seems to work, so I suppose I can stick to that. But something else: I tried shuffle #a; , where a is an array of coordinates. But that doesn't do anything. Apparently shuffle wants to have the list of coordinates it should shuffle as literals. I could not think of any better way than joining all array elements in a for-next loop into a space-separated text string, append that to the string "shuffle", and apply eval to it. Isn't there really any simpler way to do that?
Is there a GAME code command for setting the board to a given FEN code? I am currently looking into the issue of handling shuffle games. But because potentially every square on the board could be involved in a shuffle, it seems a good idea to store the entire board in a constant, like setconst startshuffle fencode; . The trick is to set up the board from the retreived constant, if that existed.
[Edit] Or would it be better to copy and restore the $space system variable, though
?
[Edit2] Well, the latter seems to work, so I suppose I can stick to that. But something else: I tried shuffle #a; , where a is an array of coordinates. But that doesn't do anything. Apparently shuffle wants to have the list of coordinates it should shuffle as literals. I could not think of any better way than joining all array elements in a for-next loop into a space-separated text string, append that to the string "shuffle", and apply eval to it. Isn't there really any simpler way to do that?