[Pachi] Expressing higher-levl Go rules

Petr Baudis pasky at ucw.cz
Sun Sep 7 11:15:00 CEST 2014


On Fri, Aug 08, 2014 at 06:55:11PM +0200, Stanisław Halik wrote:
> PS when reading commit diffs I cringe on how tricky the logic for
> the game rules and what the game rules _imply_. Eye filling rules,
> oft-dreaded selfatari, etc.
> 
> If selfatari etc. are to be redone in a more idiomatic, elegant
> fashion, is there any prior art for reasoning about groups, tsumego
> etc? If there's no prior art that's another matter.

  I don't think there is any prior art, besides just hardcoding relevant
patterns.

  Yes, the selfatari.c file is real ugly.  Of course I have planned for
it to be much simpler and shorter when I got started. :-)  However, it
is also one of the CPU profile hotspots, so handling of this does need
to be as fast as possible.

  So, I'm not sure if there's a better way to express this.  At least
I tried to put a lot of very detailed comments in there; I need them
myself too, after a few months I forget completely how it works again
and again. :-)  So my hope is that with the comments it's not *that*
intimidating for dedicated outsiders.

  I don't know of an alternative way to do this besides using hardcoded
patterns.  But hardcoding patterns with enough expressiveness (regarding
liberties of displayed stones and "touching" relationships of their
groups) might actually be something worth exploring that could work
as well as the current code does!

-- 
				Petr Baudis
	Life is short, the craft long, opportunity fleeting, experiment
	treacherous, judgment difficult.  -- Hippocrates


More information about the Pachi mailing list