MonteCarlo wrote:For now it doesn't seem like the game actually ends when you form a union with the king (i.e., you get to keep making moves even though the game is done); is that known/expected?
Well, if you hug the King of the color the computer is playing, it should prirint "XXX wins" above the board. If the computer hugs your king, it would only report it when you make another move. I guess I should test for the mate score, and already print the message then. (But I was not yet completely sure the score would always be correct.)
I haven't been able to reproduce these next reliably yet, but the very first game I played it was letting me move a pawn backwards after a union on the 6th or 7th rank.
This was probably a very temporary thing, because I was messing with the GUI script. When I first opened this thread, the GUI did not generate move highlights for the unions at all, and I though I could still quickly slip that in. But I made an error in the side-to-move detection, which took me a few minutes to correct.
I've also had it where it gives me the option to move non-unioned opposing pieces; in those cases the engine stopped moving altogether and let me make unlimited moves with its pieces:
The GUI allows you to cheat without limit. It does not enforce pseudo-legality of the moves, and not even turn order. It was derived from a fairy-diagram generator that was always in setup mode. So it had no concept of a turn, which was also useful for games that allowed double moves.
But that made it somewhat difficult to know the the engine should move. I used the rule that a move with a piece of one color would imply the other color would then be on move. If the move did not release anything. But when a union is moved, you don't know to which side it belongs. So in that case, I just toggle the side.
So if the computer is set to play black, and you move a black piece, it thinks it is now white's turn, and so it would not move. It should oly move in reply to moving of white pieces or unions when it plays black.
Perhaps I should enforce turn order and pseudo-legality. But then you canot easily set up problems. And if there is a setup mode, people could switch to it to cheat. So I figured: "why just not leave it in setup mode all the time?".