[Pachi] Low-hanging fruit - hacking ideas

Matthew Woodcraft matthew at woodcraft.me.uk
Mon May 30 16:00:27 CEST 2011


Petr Baudis wrote:
>   * Handicap placement - deep in my mailbox, I have a report buried that
> says fixed_handicap stone placement is not conforming to GTP specs.

I had a look at this, and the only thing I can see that's wrong is that
in three-stone handicap games the third stone is in the wrong corner.
Trivial patch below.

(Pachi does some strange things for handicap numbers which are out of
range for the board size, but I assume that comes under the documented
lack of error-checking in the GTP interface.)

-M-



8<--8<--8<--8<--8<--8<--8<--8<

>From 0bcc3be8d912729f64aa3770bbe1d9ffb7a430c1 Mon Sep 17 00:00:00 2001
From: Matthew Woodcraft <matthew at woodcraft.me.uk>
Date: Mon, 30 May 2011 14:53:03 +0100
Subject: [PATCH] board_handicap(): Correct placement for three-stone handicaps

---
 board.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board.c b/board.c
index 930916e..6d7e048 100644
--- a/board.c
+++ b/board.c
@@ -591,7 +591,7 @@ board_handicap(struct board *board, int stones, FILE *f)
        int mid = board_size(board) / 2;
        int max = board_size(board) - 1 - margin;
        const int places[][2] = {
-               { min, min }, { max, max }, { max, min }, { min, max },
+               { min, min }, { max, max }, { min, max }, { max, min },
                { min, mid }, { max, mid },
                { mid, min }, { mid, max },
                { mid, mid },
-- 
1.7.2.5



More information about the Pachi mailing list