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

Explicitly check for too many moves when placing a stone or passing #381

Closed herzbube closed 1 year ago

herzbube commented 1 year ago

Currently LoadGameCommand is the only place in the app that checks whether a game contains too many moves to be handled by the app. There is no such check when the user attempts to place a stone or play a pass move. When the maximum number of moves has been reached, PlayMoveCommand therefore sends a GTP command to Fuego which Fuego then rejects, resulting in an alert with the not-so-user-friendly error message "Your move was rejected by Fuego. [...] This is almost certainly a bug in Little Go."

Instead of relying on Fuego to catch the "too many moves" error, the app should explicitly check for it on its own and present an alert with a more user-friendly error message.

A consequence of this is that the app now needs to check pass moves as well as play-a-stone moves. So far the app did not contain a check for pass moves because it assumed that pass moves are always valid.