gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] Free handicap placement


From: Gunnar Farneback
Subject: [gnugo-devel] Free handicap placement
Date: Sun, 18 Aug 2002 23:39:09 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

I've put up a patch at

http://www.lysator.liu.se/~gunnar/gnugo/patches/gunnar_3_7.2.gz

that implements free handicap placement. Notice that this is not quite
the same thing as calling genmove() repeatedly for black at the
beginning of the game. The difference is that here the number of
handicap stones is known from the beginning and the placement strategy
varies (to some extent) with this number. Incidentally the new code is
also much faster than repeated genmove() calls.

The handicap placement is almost entirely pattern driven, by the
patterns in the new database handicap.db. This does include the first
stones in empty corners, as well as similar stones in open areas on
the edge or in the center. Since the pattern matcher requires an
anchor within the pattern, matching empty areas involves a trick. This
is to add four temporary stones at the 1-1 points of the board before
doing the matching and using them as anchors for otherwise empty
patterns. Afterwards these stones are of course removed again.

If the handicap is larger than the number of stones generated by the
handicap patterns, the aftermath code is called to generate further
stones, until all previously placed stones have become unconditionally
alive. After that no more handicap stones are placed.

To test how the free placement is done, fire up GNU Go in GTP mode and
issue the commands

boardsize 19
place_free_handicap 7
showboard

with your choice of board size and number of handicap stones.

- placehand() renamed to place_fixed_handicap()
- new function place_free_handicap() in handicap.c with associated
  static functions find_free_handicap_pattern() and
  free_handicap_callback()
- new GTP command place_free_handicap
- new pattern database handicap.db
- new autohelper functions remaining_handicap_stones and
  total_handicap_stones, useful from handicap.db
- mkpat.c revised to avoid compiler warnings for constraints using no
  labels

/Gunnar




reply via email to

[Prev in Thread] Current Thread [Next in Thread]