chiark / gitweb /
Pearl: revise loop detection similarly to Loopy.
authorSimon Tatham <anakin@pobox.com>
Wed, 24 Feb 2016 19:36:41 +0000 (19:36 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 24 Feb 2016 19:36:41 +0000 (19:36 +0000)
commitadc54741f03cf0cc5c639e917afd2442da9e3422
tree1e209416956c823e7f60a8fd1edd666314775b2c
parentc5500926bf7458aabb0e11945bfd24038bfeedee
Pearl: revise loop detection similarly to Loopy.

Pearl has more or less the same attitude to loops as Loopy does, in
that a loop is required in the solution but some loops during play
want to be highlighted as errors. So it makes sense to use the same
strategy for loop highlighting.

I've cloned-and-hacked the code from Loopy rather than abstracting it
out, because there were some fiddly differences in application (like
checking of untouched clues in Pearl). Perhaps some day I can come
back and make it all neater.

Also, while I'm here, I've cleaned up the loop_length field in
game_state, which was carefully set up by check_completion() but never
actually used for anything. (If I remember rightly, it was going to be
used for a fancy victory flash which never saw the light of day.)
pearl.c