herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
138 stars 54 forks source link

Allow board setup at any time during the game #401

Open herzbube opened 1 year ago

herzbube commented 1 year ago

Currently the app allows board setup to take place only at the beginning of the game. This restriction needs to be lifted if the app wants to be a proper SGF editor with full variation support. Also a future tsumego mode likely requires board setup at various stages in the tree of nodes because it's reasonable to assume that Go problems are modeled with variations.

A rough sketch of the requirements:

herzbube commented 1 year ago

The major problem with implementing this feature is that Fuego only supports stone setup on an empty board. For instance, the GTP command gogui-setup B A1 on a non-empty board fails with the error message "setup only allowed on empty board". Setting up a different side to play next (GTP command gogui-setup_player) is fine, though.

herzbube commented 1 year ago

Brain dump of some notes that I took for implementing this:

Regarding the requirement to discard future moves/nodes when board setup changes: It might be possible to go without this, but it would probably require quite complicated handling. Check out q5go, which has replace, append and insert operations for board setup.