gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] Patch: handling of move reasons made 1D


From: Inge Wallin
Subject: [gnugo-devel] Patch: handling of move reasons made 1D
Date: Tue, 9 Oct 2001 20:04:28 +0200 (MET DST)

Here is a patch which makes all handling of move reasons
1-dimensional. 

        -Inge

Index: engine/dragon.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
retrieving revision 1.16
diff -u -r1.16 dragon.c
--- engine/dragon.c     2001/10/04 18:38:53     1.16
+++ engine/dragon.c     2001/10/09 17:56:51
@@ -173,7 +173,7 @@
 
       /* Tell the move generation code about the lunch. */
       if (color != EMPTY)
-       add_lunch(m, n, i, j);
+       add_lunch(POS(m, n), POS(i, j));
        
       /* If several lunches are found, we pick the juiciest.
        * First maximize cutstone, then minimize liberties.
Index: engine/fuseki.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/fuseki.c,v
retrieving revision 1.8
diff -u -r1.8 fuseki.c
--- engine/fuseki.c     2001/10/04 18:22:33     1.8
+++ engine/fuseki.c     2001/10/09 17:56:54
@@ -180,7 +180,7 @@
     return;
 
   TRACE("Fuseki Player suggests %m with value %d\n", i, j, val);
-  set_minimum_move_value(i, j, val);
+  set_minimum_move_value(POS(i, j), val);
 }
 
 
@@ -265,7 +265,7 @@
    * traces and in the output file.
    */
   for (k = 0; k < fuseki_moves; k++)
-    set_minimum_move_value(fuseki_movei[k], fuseki_movej[k], 74);
+    set_minimum_move_value(POS(fuseki_movei[k], fuseki_movej[k]), 74);
 
   return 1;
 }
Index: engine/genmove.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/genmove.c,v
retrieving revision 1.8
diff -u -r1.8 genmove.c
--- engine/genmove.c    2001/09/26 00:35:03     1.8
+++ engine/genmove.c    2001/10/09 17:56:59
@@ -351,10 +351,10 @@
       gprintf("\nlooking for combination attacks ...\n");
     aa_val = atari_atari(color, &apos, save_verbose);
     if (aa_val)
-      add_my_atari_atari_move(I(apos), J(apos), aa_val);
+      add_my_atari_atari_move(apos, aa_val);
     aa_val = atari_atari(other, &apos, save_verbose);
     if (aa_val && safe_move(apos, color))
-      add_your_atari_atari_move(I(apos), J(apos), aa_val);
+      add_your_atari_atari_move(apos, aa_val);
     verbose = save_verbose;
   }
   time_report(1, "atari atari", -1, -1);
Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.27
diff -u -r1.27 liberty.h
--- engine/liberty.h    2001/10/06 20:00:51     1.27
+++ engine/liberty.h    2001/10/09 17:57:08
@@ -301,49 +301,51 @@
 
 /* functions to add (or remove) move reasons */
 void clear_move_reasons(void);
-void add_lunch(int ai, int aj, int bi, int bj);
-void remove_lunch(int ai, int aj, int bi, int bj);
-void add_attack_move(int ti, int tj, int ai, int aj);
-void remove_attack_move(int ti, int tj, int ai, int aj);
-int attack_move_known(int ti, int tj, int ai, int aj);
-void add_defense_move(int ti, int tj, int ai, int aj);
-void remove_defense_move(int ti, int tj, int ai, int aj);
-int defense_move_known(int ti, int tj, int ai, int aj);
-void add_attack_threat_move(int ti, int tj, int ai, int aj);
-int  attack_threat_move_known(int ti, int tj, int ai, int aj);
-void add_defense_threat_move(int ti, int tj, int ai, int aj);
-int  defense_threat_move_known(int ti, int tj, int ai, int aj);
-void add_connection_move(int ti, int tj, int ai, int aj, int bi, int bj);
-void add_cut_move(int ti, int tj, int ai, int aj, int bi, int bj);
-void add_antisuji_move(int ti, int tj);
-void add_semeai_move(int ti, int tj, int ai, int aj);
-void add_semeai_threat(int ti, int tj, int ai, int aj);
-void add_owl_attack_move(int ti, int tj, int ai, int aj);
-void add_owl_defense_move(int ti, int tj, int ai, int aj);
-void add_owl_attack_threat_move(int ti, int tj, int ai, int aj);
-void add_owl_defense_threat_move(int ti, int tj, int ai, int aj);
-void add_owl_prevent_threat_move(int ti, int tj, int ai, int aj);
-void add_owl_uncertain_defense_move(int ti, int tj, int ai, int aj);
-void add_owl_uncertain_attack_move(int ti, int tj, int ai, int aj);
-void add_my_atari_atari_move(int, int, int);
-void add_your_atari_atari_move(int, int, int);
-void add_vital_eye_move(int ti, int tj, int ai, int aj, int color);
-void add_attack_either_move(int ti, int tj, int ai, int aj, int bi, int bj);
-void add_defend_both_move(int ti, int tj, int ai, int aj, int bi, int bj);
-void add_block_territory_move(int ti, int tj);
-void add_expand_territory_move(int ti, int tj);
-void add_expand_moyo_move(int ti, int tj);
-void add_strategical_attack_move(int ti, int tj, int ai, int aj);
-void add_strategical_defense_move(int ti, int tj, int ai, int aj);
-void add_worthwhile_threat_move(int ti, int tj);
-void set_minimum_move_value(int ti, int tj, float value);
-void set_maximum_move_value(int ti, int tj, float value);
-void set_minimum_territorial_value(int ti, int tj, float value);
-void set_maximum_territorial_value(int ti, int tj, float value);
-void add_shape_value(int ti, int tj, float value);
-void add_followup_value(int tt, float value);
-void add_reverse_followup_value(int tt, float value);
-void add_replacement_move(int ai, int aj, int bi, int bj);
+void add_lunch(int eater, int food);
+void remove_lunch(int eater, int food);
+void add_attack_move(int pos, int ww);
+void remove_attack_move(int pos, int ww);
+int  attack_move_known(int pos, int ww);
+void add_defense_move(int pos, int ww);
+void remove_defense_move(int pos, int ww);
+int  defense_move_known(int pos, int ww);
+void add_attack_threat_move(int pos, int ww);
+int  attack_threat_move_known(int pos, int ww);
+void add_defense_threat_move(int pos, int ww);
+int  defense_threat_move_known(int pos, int ww);
+void add_connection_move(int pos, int dr1, int dr2);
+void add_cut_move(int pos, int dr1, int dr2);
+void add_antisuji_move(int pos);
+void add_semeai_move(int pos, int dr);
+void add_semeai_threat(int pos, int dr);
+
+void add_owl_attack_move(int pos, int dr);
+void add_owl_defense_move(int pos, int dr);
+void add_owl_attack_threat_move(int pos, int dr);
+void add_owl_defense_threat_move(int pos, int dr);
+void add_owl_prevent_threat_move(int pos, int dr);
+void add_owl_uncertain_defense_move(int pos, int dr);
+void add_owl_uncertain_attack_move(int pos, int dr);
+
+void add_my_atari_atari_move(int pos, int size);
+void add_your_atari_atari_move(int pos, int size);
+void add_vital_eye_move(int pos, int eyespace, int color);
+void add_attack_either_move(int pos, int str1, int str2);
+void add_defend_both_move(int pos, int str1, int str2);
+void add_block_territory_move(int pos);
+void add_expand_territory_move(int pos);
+void add_expand_moyo_move(int pos);
+void add_strategical_attack_move(int pos, int dr);
+void add_strategical_defense_move(int pos, int dr);
+void add_worthwhile_threat_move(int pos);
+void add_replacement_move(int from, int to);
+void set_minimum_move_value(int pos, float value);
+void set_maximum_move_value(int pos, float value);
+void set_minimum_territorial_value(int pos, float value);
+void set_maximum_territorial_value(int pos, float value);
+void add_shape_value(int pos, float value);
+void add_followup_value(int pos, float value);
+void add_reverse_followup_value(int pos, float value);
 
 void find_stones_saved_by_move(int i, int j, int color,
                                char saved_stones[MAX_BOARD][MAX_BOARD]);
Index: engine/move_reasons.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/move_reasons.c,v
retrieving revision 1.23
diff -u -r1.23 move_reasons.c
--- engine/move_reasons.c       2001/10/06 21:01:04     1.23
+++ engine/move_reasons.c       2001/10/09 17:57:49
@@ -260,13 +260,13 @@
  * (a worm).
  */
 void
-add_lunch(int ai, int aj, int bi, int bj)
+add_lunch(int eater, int food)
 {
   int k;
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
-  int worm1   = find_worm(worm[POS(bi, bj)].origin);
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
+  int dragon1 = find_dragon(dragon[eater].origin);
+  int worm1   = find_worm(worm[food].origin);
+  ASSERT_ON_BOARD1(eater);
+  ASSERT_ON_BOARD1(food);
   
   for (k = 0; k < next_lunch; k++)
     if ((lunch_dragon[k] == dragon1) && (lunch_worm[k] == worm1))
@@ -285,13 +285,13 @@
  * of eater (a dragon) and food (a worm).  
  */
 void
-remove_lunch(int ai, int aj, int bi, int bj)
+remove_lunch(int eater, int food)
 {
   int k;
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
-  int worm1   = find_worm(worm[POS(bi, bj)].origin);
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
+  int dragon1 = find_dragon(dragon[eater].origin);
+  int worm1   = find_worm(worm[food].origin);
+  ASSERT_ON_BOARD1(eater);
+  ASSERT_ON_BOARD1(food);
   
   for (k = 0; k < next_lunch; k++)
     if ((lunch_dragon[k] == dragon1) && (lunch_worm[k] == worm1))
@@ -330,7 +330,7 @@
 }
 
 /*
- * Add a move reason for (ti, tj) if it's not already there or the
+ * Add a move reason for (pos) if it's not already there or the
  * table is full.
  */ 
 static void
@@ -357,7 +357,7 @@
 }
 
 /*
- * Remove a move reason for (ti, tj). Ignore silently if the reason
+ * Remove a move reason for (pos). Ignore silently if the reason
  * wasn't there.
  */ 
 static void
@@ -411,31 +411,31 @@
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it attacks the worm
- * at (ai, aj).
+ * Add to the reasons for the move at (pos) that it attacks the worm
+ * at (ww).
  */
 void
-add_attack_move(int ti, int tj, int ai, int aj)
+add_attack_move(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), ATTACK_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  add_move_reason(pos, ATTACK_MOVE, worm_number);
 }
 
 /* Query whether an attack move is already known. */
 int
-attack_move_known(int ti, int tj, int ai, int aj)
+attack_move_known(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  return move_reason_known(POS(ti, tj), ATTACK_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  return move_reason_known(pos, ATTACK_MOVE, worm_number);
 }
 
 /*
- * Remove from the reasons for the move at (ti, tj) that it attacks
- * the worm at (ai, aj). We do this by adding a NON_ATTACK move
+ * Remove from the reasons for the move at (pos) that it attacks
+ * the worm at (ww). We do this by adding a NON_ATTACK move
  * reason and wait until later to actually remove it. Otherwise it may
  * be added again.
  *
@@ -444,41 +444,41 @@
  * to actually remove it.
  */
 void
-remove_attack_move(int ti, int tj, int ai, int aj)
+remove_attack_move(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  if (move_reason_known(POS(ti, tj), ATTACK_MOVE, worm_number))
-    add_move_reason(POS(ti, tj), NON_ATTACK_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  if (move_reason_known(pos, ATTACK_MOVE, worm_number))
+    add_move_reason(pos, NON_ATTACK_MOVE, worm_number);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it defends the worm
- * at (ai, aj).
+ * Add to the reasons for the move at (pos) that it defends the worm
+ * at (ww).
  */
 void
-add_defense_move(int ti, int tj, int ai, int aj)
+add_defense_move(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), DEFEND_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  add_move_reason(pos, DEFEND_MOVE, worm_number);
 }
 
 /* Query whether a defense move is already known. */
 int
-defense_move_known(int ti, int tj, int ai, int aj)
+defense_move_known(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  return move_reason_known(POS(ti, tj), DEFEND_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  return move_reason_known(pos, DEFEND_MOVE, worm_number);
 }
 
 /*
- * Remove from the reasons for the move at (ti, tj) that it defends
- * the worm at (ai, aj). We do this by adding a NON_DEFEND move
+ * Remove from the reasons for the move at (pos) that it defends
+ * the worm at (ww). We do this by adding a NON_DEFEND move
  * reason and wait until later to actually remove it. Otherwise it may
  * be added again.
  *
@@ -487,112 +487,112 @@
  * to actually remove it.
  */
 void
-remove_defense_move(int ti, int tj, int ai, int aj)
+remove_defense_move(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  if (move_reason_known(POS(ti, tj), DEFEND_MOVE, worm_number))
-    add_move_reason(POS(ti, tj), NON_DEFEND_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  if (move_reason_known(pos, DEFEND_MOVE, worm_number))
+    add_move_reason(pos, NON_DEFEND_MOVE, worm_number);
 }
 
 
 /*
- * Add to the reasons for the move at (ti, tj) that it threatens to
- * attack the worm at (ai, aj). 
+ * Add to the reasons for the move at (pos) that it threatens to
+ * attack the worm at (ww). 
  */
 void
-add_attack_threat_move(int ti, int tj, int ai, int aj)
+add_attack_threat_move(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), ATTACK_THREAT_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  add_move_reason(pos, ATTACK_THREAT_MOVE, worm_number);
 }
 
 /* Query whether a threat to attack move is already known. */
 int
-attack_threat_move_known(int ti, int tj, int ai, int aj)
+attack_threat_move_known(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  return move_reason_known(POS(ti, tj), ATTACK_THREAT_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  return move_reason_known(pos, ATTACK_THREAT_MOVE, worm_number);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it defends the worm
- * at (ai, aj).
+ * Add to the reasons for the move at (pos) that it defends the worm
+ * at (ww).
  */
 void
-add_defense_threat_move(int ti, int tj, int ai, int aj)
+add_defense_threat_move(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), DEFEND_THREAT_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  add_move_reason(pos, DEFEND_THREAT_MOVE, worm_number);
 }
 
 /* Query whether a threat to defense move is already known. */
 int
-defense_threat_move_known(int ti, int tj, int ai, int aj)
+defense_threat_move_known(int pos, int ww)
 {
-  int worm_number = find_worm(worm[POS(ai, aj)].origin);
+  int worm_number = find_worm(worm[ww].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  return move_reason_known(POS(ti, tj), DEFEND_THREAT_MOVE, worm_number);
+  ASSERT_ON_BOARD1(ww);
+  return move_reason_known(pos, DEFEND_THREAT_MOVE, worm_number);
 }
 
 
 /*
- * Add to the reasons for the move at (ti, tj) that it connects the
- * dragons at (ai, aj) and (bi, bj). Require that the dragons are
+ * Add to the reasons for the move at (pos) that it connects the
+ * dragons at (dr1) and (dr2). Require that the dragons are
  * distinct.
  */
 void
-add_connection_move(int ti, int tj, int ai, int aj, int bi, int bj)
+add_connection_move(int pos, int dr1, int dr2)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
-  int dragon2 = find_dragon(dragon[POS(bi, bj)].origin);
+  int dragon1 = find_dragon(dragon[dr1].origin);
+  int dragon2 = find_dragon(dragon[dr2].origin);
   int connection;
 
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
-  gg_assert (dragon[POS(ai, aj)].color == dragon[POS(bi, bj)].color);
+  ASSERT_ON_BOARD1(dr1);
+  ASSERT_ON_BOARD1(dr2);
+  gg_assert (dragon[dr1].color == dragon[dr2].color);
   if (dragon1 == dragon2)
     return;
   connection = find_connection(dragon1, dragon2);
-  add_move_reason(POS(ti, tj), CONNECT_MOVE, connection);
+  add_move_reason(pos, CONNECT_MOVE, connection);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it cuts the
- * dragons at (ai, aj) and (bi, bj). Require that the dragons are
+ * Add to the reasons for the move at (pos) that it cuts the
+ * dragons at (dr1) and (dr2). Require that the dragons are
  * distinct.
  */
 void
-add_cut_move(int ti, int tj, int ai, int aj, int bi, int bj)
+add_cut_move(int pos, int dr1, int dr2)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
-  int dragon2 = find_dragon(dragon[POS(bi, bj)].origin);
+  int dragon1 = find_dragon(dragon[dr1].origin);
+  int dragon2 = find_dragon(dragon[dr2].origin);
   int connection;
 
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
-  gg_assert (dragon[POS(ai, aj)].color == dragon[POS(bi, bj)].color);
+  ASSERT_ON_BOARD1(dr1);
+  ASSERT_ON_BOARD1(dr2);
+  gg_assert (dragon[dr1].color == dragon[dr2].color);
   if (dragon1 == dragon2)
     return;
   connection = find_connection(dragon1, dragon2);
   
   /*
-   * Ignore the cut or connection if either (ai, aj) or (bi, bj)
+   * Ignore the cut or connection if either (dr1) or (dr2)
    * points to a tactically captured worm.
    */
-  if ((worm[POS(ai, aj)].attack_code != 0 && worm[POS(ai, aj)].defend_code == 
0)
-      || (worm[POS(bi, bj)].attack_code != 0 && worm[POS(bi, bj)].defend_code 
== 0))
+  if ((worm[dr1].attack_code != 0 && worm[dr1].defend_code == 0)
+      || (worm[dr2].attack_code != 0 && worm[dr2].defend_code == 0))
     return;
   
-  add_move_reason(POS(ti, tj), CUT_MOVE, connection);
+  add_move_reason(pos, CUT_MOVE, connection);
 }
 
 /*
@@ -601,112 +601,113 @@
  * must *not* be played.
  */
 void
-add_antisuji_move(int ti, int tj)
+add_antisuji_move(int pos)
 {
-  add_move_reason(POS(ti, tj), ANTISUJI_MOVE, 0);
+  add_move_reason(pos, ANTISUJI_MOVE, 0);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it wins the
- * dragon (friendly or not) at (ai, aj) in semeai. Since it is
+ * Add to the reasons for the move at (pos) that it wins the
+ * dragon (friendly or not) at (dr) in semeai. Since it is
  * possible that in some semeai one player can kill but the
  * other can only make seki, it is possible that one dragon
  * is already alive in seki. Therefore separate move reasons
  * must be added for the two dragons.
  */
 void
-add_semeai_move(int ti, int tj, int ai, int aj)
+add_semeai_move(int pos, int dr)
 {
-  int the_dragon = find_dragon(dragon[POS(ai, aj)].origin);
+  int the_dragon = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), SEMEAI_MOVE, the_dragon);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, SEMEAI_MOVE, the_dragon);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that given two
+ * Add to the reasons for the move at (pos) that given two
  * moves in a row a move here can win the dragon (friendly or
- * not) at (ai, aj) in semeai. Such a move can be used as a 
+ * not) at (dr) in semeai. Such a move can be used as a 
  * ko threat, and it is also given some value due to uncertainty
  * in the counting of liberties.
  */
 void
-add_semeai_threat(int ti, int tj, int ai, int aj)
+add_semeai_threat(int pos, int dr)
 {
-  int the_dragon = find_dragon(dragon[POS(ai, aj)].origin);
+  int the_dragon = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), SEMEAI_THREAT, the_dragon);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, SEMEAI_THREAT, the_dragon);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it's the vital
- * point for the eye space at (ai, aj) of color.
+ * Add to the reasons for the move at (pos) that it's the vital
+ * point for the eye space at (eyespace) of color.
  */
 void
-add_vital_eye_move(int ti, int tj, int ai, int aj, int color)
+add_vital_eye_move(int pos, int eyespace, int color)
 {
   int eye;
-  ASSERT_ON_BOARD2(ai, aj);
+
+  ASSERT_ON_BOARD1(eyespace);
   if (color == WHITE)
-    eye = find_eye(white_eye[POS(ai, aj)].origin, color);
+    eye = find_eye(white_eye[eyespace].origin, color);
   else
-    eye = find_eye(black_eye[POS(ai, aj)].origin, color);
-  add_move_reason(POS(ti, tj), VITAL_EYE_MOVE, eye);
+    eye = find_eye(black_eye[eyespace].origin, color);
+  add_move_reason(pos, VITAL_EYE_MOVE, eye);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it attacks
- * either (ai, aj) or (bi, bj) (e.g. a double atari). This move
+ * Add to the reasons for the move at (pos) that it attacks
+ * either (str1) or (str2) (e.g. a double atari). This move
  * reason is only used for double attacks on opponent stones.
  *
  * Before accepting the move reason, check that the worms are
  * distinct and that neither is undefendable.
  */
 void
-add_attack_either_move(int ti, int tj, int ai, int aj, int bi, int bj)
+add_attack_either_move(int pos, int str1, int str2)
 {
-  int worm1 = find_worm(worm[POS(ai, aj)].origin);
-  int worm2 = find_worm(worm[POS(bi, bj)].origin);
+  int worm1 = find_worm(worm[str1].origin);
+  int worm2 = find_worm(worm[str2].origin);
   int worm_pair;
 
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
+  ASSERT_ON_BOARD1(str1);
+  ASSERT_ON_BOARD1(str2);
   if (worm1 == worm2)
     return;
-  if (worm[POS(ai, aj)].attack_code != 0 && worm[POS(ai, aj)].defend_code == 0)
+  if (worm[str1].attack_code != 0 && worm[str2].defend_code == 0)
     return;
-  if (worm[POS(bi, bj)].attack_code != 0 && worm[POS(bi, bj)].defend_code == 0)
+  if (worm[str2].attack_code != 0 && worm[str2].defend_code == 0)
     return;
   worm_pair = find_worm_pair(worm1, worm2);
-  add_move_reason(POS(ti, tj), ATTACK_EITHER_MOVE, worm_pair);
+  add_move_reason(pos, ATTACK_EITHER_MOVE, worm_pair);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it defends
- * both (ai, aj) and (bi, bj) (e.g. from a double atari). This move
+ * Add to the reasons for the move at (pos) that it defends
+ * both (str1) and (str2) (e.g. from a double atari). This move
  * reason is only used for defense of own stones.
  */
 void
-add_defend_both_move(int ti, int tj, int ai, int aj, int bi, int bj)
+add_defend_both_move(int pos, int str1, int str2)
 {
-  int worm1 = find_worm(worm[POS(ai, aj)].origin);
-  int worm2 = find_worm(worm[POS(bi, bj)].origin);
+  int worm1 = find_worm(worm[str1].origin);
+  int worm2 = find_worm(worm[str2].origin);
   int worm_pair = find_worm_pair(worm1, worm2);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
-  add_move_reason(POS(ti, tj), DEFEND_BOTH_MOVE, worm_pair);
+  ASSERT_ON_BOARD1(str1);
+  ASSERT_ON_BOARD1(str2);
+  add_move_reason(pos, DEFEND_BOTH_MOVE, worm_pair);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it secures
+ * Add to the reasons for the move at (pos) that it secures
  * territory by blocking.
  */
 void
-add_block_territory_move(int ti, int tj)
+add_block_territory_move(int pos)
 {
-  add_move_reason(POS(ti, tj), BLOCK_TERRITORY_MOVE, 0);
+  add_move_reason(pos, BLOCK_TERRITORY_MOVE, 0);
 }
 
 /*
@@ -714,19 +715,19 @@
  * territory.
  */
 void
-add_expand_territory_move(int ti, int tj)
+add_expand_territory_move(int pos)
 {
-  add_move_reason(POS(ti, tj), EXPAND_TERRITORY_MOVE, 0);
+  add_move_reason(pos, EXPAND_TERRITORY_MOVE, 0);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it expands
+ * Add to the reasons for the move at (pos) that it expands
  * moyo.
  */
 void
-add_expand_moyo_move(int ti, int tj)
+add_expand_moyo_move(int pos)
 {
-  add_move_reason(POS(ti, tj), EXPAND_MOYO_MOVE, 0);
+  add_move_reason(pos, EXPAND_MOYO_MOVE, 0);
 }
 
 /*
@@ -739,19 +740,19 @@
  * shape contributions.
  */
 void
-add_shape_value(int ti, int tj, float value)
+add_shape_value(int pos, float value)
 {
-  ASSERT_ON_BOARD2(ti, tj);
+  ASSERT_ON_BOARD1(pos);
   if (value > 0.0) {
-    if (value > move[POS(ti, tj)].maxpos_shape)
-      move[POS(ti, tj)].maxpos_shape = value;
-    move[POS(ti, tj)].numpos_shape += 1;
+    if (value > move[pos].maxpos_shape)
+      move[pos].maxpos_shape = value;
+    move[pos].numpos_shape += 1;
   }
   else if (value < 0.0) {
     value = -value;
-    if (value > move[POS(ti, tj)].maxneg_shape)
-      move[POS(ti, tj)].maxneg_shape = value;
-    move[POS(ti, tj)].numneg_shape += 1;
+    if (value > move[pos].maxneg_shape)
+      move[pos].maxneg_shape = value;
+    move[pos].numneg_shape += 1;
   }
 }
 
@@ -759,9 +760,9 @@
  * Flag that this move is worthwhile to play as a pure threat move.
  */
 void
-add_worthwhile_threat_move(int ti, int tj)
+add_worthwhile_threat_move(int pos)
 {
-  move[POS(ti, tj)].worthwhile_threat = 1;
+  move[pos].worthwhile_threat = 1;
 }
 
 /* 
@@ -795,71 +796,71 @@
 
 
 /*
- * Add to the reasons for the move at (ti, tj) that it attacks
- * the dragon (ai, aj) on a strategical level.
+ * Add to the reasons for the move at (pos) that it attacks
+ * the dragon (dr) on a strategical level.
  */
 void
-add_strategical_attack_move(int ti, int tj, int ai, int aj)
+add_strategical_attack_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), STRATEGIC_ATTACK_MOVE, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, STRATEGIC_ATTACK_MOVE, dragon1);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that it defends
- * the dragon (ai, aj) on a strategical level.
+ * Add to the reasons for the move at (pos) that it defends
+ * the dragon (dr) on a strategical level.
  */
 void
-add_strategical_defense_move(int ti, int tj, int ai, int aj)
+add_strategical_defense_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), STRATEGIC_DEFEND_MOVE, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, STRATEGIC_DEFEND_MOVE, dragon1);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that the owl
- * code reports an attack on the dragon (ai, aj).
+ * Add to the reasons for the move at (pos) that the owl
+ * code reports an attack on the dragon (dr).
  */
 void
-add_owl_attack_move(int ti, int tj, int ai, int aj)
+add_owl_attack_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), OWL_ATTACK_MOVE, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, OWL_ATTACK_MOVE, dragon1);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that the owl
- * code reports a defense of the dragon (ai, aj).
+ * Add to the reasons for the move at (pos) that the owl
+ * code reports a defense of the dragon (dr).
  */
 void
-add_owl_defense_move(int ti, int tj, int ai, int aj)
+add_owl_defense_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), OWL_DEFEND_MOVE, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, OWL_DEFEND_MOVE, dragon1);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that the owl
- * code reports a move threatening to attack the dragon enemy (ai, aj).
- * That is, if the attacker is given two moves in a row, (ti, tj)
+ * Add to the reasons for the move at (pos) that the owl
+ * code reports a move threatening to attack the dragon enemy (dr).
+ * That is, if the attacker is given two moves in a row, (pos)
  * can be the first move.
  */
 void
-add_owl_attack_threat_move(int ti, int tj, int ai, int aj)
+add_owl_attack_threat_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), OWL_ATTACK_THREAT, dragon1);
-  add_worthwhile_threat_move(ti, tj);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, OWL_ATTACK_THREAT, dragon1);
+  add_worthwhile_threat_move(pos);
 }
 
 /* The owl code found the friendly dragon alive, or the unfriendly dragon
@@ -868,12 +869,12 @@
  */
 
 void
-add_owl_uncertain_defense_move(int ti, int tj, int ai, int aj)
+add_owl_uncertain_defense_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), UNCERTAIN_OWL_DEFENSE, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, UNCERTAIN_OWL_DEFENSE, dragon1);
 }
 
 /* The owl code found the opponent dragon alive, or the friendly
@@ -882,28 +883,28 @@
  */
 
 void
-add_owl_uncertain_attack_move(int ti, int tj, int ai, int aj)
+add_owl_uncertain_attack_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), UNCERTAIN_OWL_ATTACK, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, UNCERTAIN_OWL_ATTACK, dragon1);
 }
 
 /*
- * Add to the reasons for the move at (ti, tj) that the owl
- * code reports a move threatening to rescue the dragon (ai, aj).
- * That is, if the defender is given two moves in a row, (ti, tj)
+ * Add to the reasons for the move at (pos) that the owl
+ * code reports a move threatening to rescue the dragon (dr).
+ * That is, if the defender is given two moves in a row, (pos)
  * can be the first move.
  */
 void
-add_owl_defense_threat_move(int ti, int tj, int ai, int aj)
+add_owl_defense_threat_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), OWL_DEFENSE_THREAT, dragon1);
-  add_worthwhile_threat_move(ti, tj);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, OWL_DEFENSE_THREAT, dragon1);
+  add_worthwhile_threat_move(pos);
 }
 
 /* Add to the reasons for the move at (ti, tj) that it captures
@@ -912,9 +913,9 @@
  * permitted per move.
  */
 void
-add_my_atari_atari_move(int ti, int tj, int size)
+add_my_atari_atari_move(int pos, int size)
 {
-  add_move_reason(POS(ti, tj), MY_ATARI_ATARI_MOVE, size);
+  add_move_reason(pos, MY_ATARI_ATARI_MOVE, size);
 }
 
 /* Add to the reasons for the move at (ti, tj) that an opponent move there
@@ -923,143 +924,143 @@
  * by the defender is safe---presumably it defends the threat.
  * Only one such move reason is permitted per move.  */
 void
-add_your_atari_atari_move(int ti, int tj, int size)
+add_your_atari_atari_move(int pos, int size)
 {
-  add_move_reason(POS(ti, tj), YOUR_ATARI_ATARI_MOVE, size);
+  add_move_reason(pos, YOUR_ATARI_ATARI_MOVE, size);
 }
 
 
 /*
- * Add to the reasons for the move at (ti, tj) that the owl
- * code reports a move threatening to defend the dragon enemy (ai, aj),
- * and that (ti, tj) is a move which attacks the dragon. 
- * That is, if the defender is given two moves in a row, (ti, tj)
- * can be the first move. Hopefully playing at (ti, tj) makes it harder 
+ * Add to the reasons for the move at (pos) that the owl
+ * code reports a move threatening to defend the dragon enemy (dr),
+ * and that (pos) is a move which attacks the dragon. 
+ * That is, if the defender is given two moves in a row, (pos)
+ * can be the first move. Hopefully playing at (pos) makes it harder 
  * for the dragon to live.
  */
 void
-add_owl_prevent_threat_move(int ti, int tj, int ai, int aj)
+add_owl_prevent_threat_move(int pos, int dr)
 {
-  int dragon1 = find_dragon(dragon[POS(ai, aj)].origin);
+  int dragon1 = find_dragon(dragon[dr].origin);
 
-  ASSERT_ON_BOARD2(ai, aj);
-  add_move_reason(POS(ti, tj), OWL_PREVENT_THREAT, dragon1);
+  ASSERT_ON_BOARD1(dr);
+  add_move_reason(pos, OWL_PREVENT_THREAT, dragon1);
 }
 
 /*
  * Add value of followup moves. 
  */
 void
-add_followup_value(int tt, float value)
+add_followup_value(int pos, float value)
 {
-  ASSERT_ON_BOARD1(tt);
-  if (value > move[tt].followup_value)
-    move[tt].followup_value = value;
+  ASSERT_ON_BOARD1(pos);
+  if (value > move[pos].followup_value)
+    move[pos].followup_value = value;
 }
 
 /*
  * Add value of inverse followup moves. 
  */
 void
-add_reverse_followup_value(int tt, float value)
+add_reverse_followup_value(int pos, float value)
 {
-  ASSERT_ON_BOARD1(tt);
-  if (value > move[tt].reverse_followup_value)
-    move[tt].reverse_followup_value = value;
+  ASSERT_ON_BOARD1(pos);
+  if (value > move[pos].reverse_followup_value)
+    move[pos].reverse_followup_value = value;
 }
 
 /*
  * Set a minimum allowed value for the move.
  */
 void
-set_minimum_move_value(int ti, int tj, float value)
+set_minimum_move_value(int pos, float value)
 {
-  ASSERT_ON_BOARD2(ti, tj);
-  if (value > move[POS(ti, tj)].min_value)
-    move[POS(ti, tj)].min_value = value;
+  ASSERT_ON_BOARD1(pos);
+  if (value > move[pos].min_value)
+    move[pos].min_value = value;
 }
 
 /*
  * Set a maximum allowed value for the move.
  */
 void
-set_maximum_move_value(int ti, int tj, float value)
+set_maximum_move_value(int pos, float value)
 {
-  ASSERT_ON_BOARD2(ti, tj);
-  if (value < move[POS(ti, tj)].max_value)
-    move[POS(ti, tj)].max_value = value;
+  ASSERT_ON_BOARD1(pos);
+  if (value < move[pos].max_value)
+    move[pos].max_value = value;
 }
 
 /*
  * Set a minimum allowed territorial value for the move.
  */
 void
-set_minimum_territorial_value(int ti, int tj, float value)
+set_minimum_territorial_value(int pos, float value)
 {
-  ASSERT_ON_BOARD2(ti, tj);
-  if (value > move[POS(ti, tj)].min_territory)
-    move[POS(ti, tj)].min_territory = value;
+  ASSERT_ON_BOARD1(pos);
+  if (value > move[pos].min_territory)
+    move[pos].min_territory = value;
 }
 
 /*
  * Set a maximum allowed territorial value for the move.
  */
 void
-set_maximum_territorial_value(int ti, int tj, float value)
+set_maximum_territorial_value(int pos, float value)
 {
-  ASSERT_ON_BOARD2(ti, tj);
-  if (value < move[POS(ti, tj)].max_territory)
-    move[POS(ti, tj)].max_territory = value;
+  ASSERT_ON_BOARD1(pos);
+  if (value < move[pos].max_territory)
+    move[pos].max_territory = value;
 }
 
 /* 
- * Add a point redistribution rule, sending the points from (ai, aj)
- * to (bi, bj). 
+ * Add a point redistribution rule, sending the points from (from)
+ * to (to). 
  */
 void
-add_replacement_move(int ai, int aj, int bi, int bj)
+add_replacement_move(int from, int to)
 {
-  int ci, cj;
+  int cc;
   int m, n;
+  int ii;
 
-  ASSERT_ON_BOARD2(ai, aj);
-  ASSERT_ON_BOARD2(bi, bj);
-  ci = I(replacement_map[POS(bi, bj)]);
-  cj = J(replacement_map[POS(bi, bj)]);
+  ASSERT_ON_BOARD1(from);
+  ASSERT_ON_BOARD1(to);
+  cc = replacement_map[to];
 
   /* First check for an incompatible redistribution rule. */
-  if (replacement_map[POS(ai, aj)] != NO_MOVE) {
-    int di = I(replacement_map[POS(ai, aj)]);
-    int dj = J(replacement_map[POS(ai, aj)]);
+  if (replacement_map[from] != NO_MOVE) {
+    int dd = replacement_map[from];
+
     /* Crash if the old rule isn't compatible with the new one. */
-    ASSERT2((bi == di && bj == dj)
-          || (POS(bi, bj) == replacement_map[POS(di, dj)]), ai, aj);
+    ASSERT1(dd == to || to == replacement_map[dd], from);
     /* There already is a compatible redistribution in effect so we
      * have nothing more to do.
      */
     return;
   }
 
-  TRACE("Move at %m is replaced by %m.\n", ai, aj, bi, bj);    
+  TRACE("Move at %1m is replaced by %1m.\n", from, to);    
 
   /* Verify that we don't introduce a cyclic redistribution. */
-  if (ci == ai && cj == aj) {
+  if (cc == from) {
     gprintf("Cyclic point redistribution detected.\n");
-    ASSERT2(0, ai, aj);
+    ASSERT1(0, from);
   }
 
   /* Update the replacement map. Make sure that all replacements
    * always are directed immediately to the final destination.
    */
-  if (ci != -1)
-    replacement_map[POS(ai, aj)] = POS(ci, cj);
+  if (cc != NO_MOVE)
+    replacement_map[from] = cc;
   else
-    replacement_map[POS(ai, aj)] = POS(bi, bj);
+    replacement_map[from] = to;
   
   for (m = 0; m < board_size; m++)
     for (n = 0; n < board_size; n++) {
-      if (replacement_map[POS(m, n)] == POS(ai, aj))
-       replacement_map[POS(m, n)] = replacement_map[POS(ai, aj)];
+      ii = POS(m, n);
+      if (replacement_map[ii] == from)
+       replacement_map[ii] = replacement_map[from];
     }
 }
 
@@ -1143,7 +1144,7 @@
                TRACE("%ofound extra point of defense of %1m at %1m\n", 
                      aa, pos);
                cursor_at_start_of_line = 1;
-               add_defense_move(I(pos), J(pos), I(aa), J(aa));
+               add_defense_move(pos, aa);
              }
            
            /* string of opponent color, see if there still is a defense,
@@ -1171,7 +1172,7 @@
                  TRACE("%ofound extra point of attack of %1m at %1m\n",
                        aa, pos);
                  cursor_at_start_of_line = 1;
-                 add_attack_move(I(pos), J(pos), I(aa), J(aa));
+                 add_attack_move(pos, aa);
                }
              }
          }
@@ -1363,7 +1364,7 @@
                 && board[dd] == OTHER_COLOR(color)))
            && !move_reason_known(pos, OWL_ATTACK_MOVE, what)
            && owl_does_attack(m, n, I(dd), J(dd))) {
-         add_owl_attack_move(m, n, I(dd), J(dd));
+         add_owl_attack_move(POS(m, n), dd);
          TRACE("Move at %1m owl attacks %1m.\n", pos, dd);
        }
        
@@ -1373,7 +1374,7 @@
                 && board[dd] == color))
            && !move_reason_known(pos, OWL_DEFEND_MOVE, what)
            && owl_does_defend(m, n, I(dd), J(dd))) {
-         add_owl_defense_move(m, n, I(dd), J(dd));
+         add_owl_defense_move(POS(m, n), dd);
          TRACE("Move at %1m owl defends %1m.\n", pos, dd);
        }
       }
@@ -1513,10 +1514,10 @@
                        && DRAGON2(I(dd), J(dd)).safety != INVINCIBLE)
                    || (DRAGON2(I(ee), J(ee)).safety != STRONGLY_ALIVE
                        && DRAGON2(I(ee), J(ee)).safety != INVINCIBLE))
-                 add_connection_move(I(pos), J(pos), I(dd), J(dd), I(ee), 
J(ee));
+                 add_connection_move(pos, dd, ee);
              }
              else
-               add_cut_move(I(pos), J(pos), I(dd), J(dd), I(ee), J(ee));
+               add_cut_move(pos, dd, ee);
            }
          }
        }
@@ -1565,10 +1566,10 @@
                        && DRAGON2(I(dd), J(dd)).safety != INVINCIBLE)
                    || (DRAGON2(I(ee), J(ee)).safety != STRONGLY_ALIVE
                        && DRAGON2(I(ee), J(ee)).safety != INVINCIBLE))
-                 add_connection_move(I(pos), J(pos), I(dd), J(dd), I(ee), 
J(ee));
+                 add_connection_move(pos, dd, ee);
              }
              else
-               add_cut_move(I(pos), J(pos), I(dd), J(dd), I(ee), J(ee));
+               add_cut_move(pos, dd, ee);
            }
          }
        }
Index: engine/optics.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/optics.c,v
retrieving revision 1.16
diff -u -r1.16 optics.c
--- engine/optics.c     2001/10/04 18:38:53     1.16
+++ engine/optics.c     2001/10/09 17:58:07
@@ -1694,8 +1694,7 @@
              if (graphs[graph].vertex[k].type == '*' ||
                  graphs[graph].vertex[k].type == '<') {
                /* add attack vital move */
-               add_vital_eye_move(I(vpos[map[k]]), J(vpos[map[k]]),
-                                  i, j, eye_color);
+               add_vital_eye_move(vpos[map[k]], POS(i, j), eye_color);
              }
              else if (graphs[graph].vertex[k].type == '@' ||
                       graphs[graph].vertex[k].type == '(') {
@@ -1710,14 +1709,12 @@
                  struct half_eye_data *this_half_eye = &heye[vpos[map[k]-1]];
 
                  for (ix = 0; ix < this_half_eye->num_attacks; ix++) {
-                   add_vital_eye_move(I(this_half_eye->attack_point[ix]),
-                                      J(this_half_eye->attack_point[ix]), 
-                                      i, j, eye_color);
+                   add_vital_eye_move(this_half_eye->attack_point[ix],
+                                      POS(i, j), eye_color);
                  }
                }
                else {
-                 add_vital_eye_move(I(vpos[map[k]]), J(vpos[map[k]]),
-                                    i, j, eye_color);
+                 add_vital_eye_move(vpos[map[k]], POS(i, j), eye_color);
                }
              }
            }
@@ -1725,8 +1722,7 @@
              if (graphs[graph].vertex[k].type == '*' ||
                  graphs[graph].vertex[k].type == '>')
                /* add defense vital move */
-               add_vital_eye_move(I(vpos[map[k]]), J(vpos[map[k]]),
-                                  i, j, eye_color);
+               add_vital_eye_move(vpos[map[k]], POS(i, j), eye_color);
              else if (graphs[graph].vertex[k].type == '@' ||
                       graphs[graph].vertex[k].type == ')') {
                /* check for marginal matching half eye diagonal */
@@ -1736,14 +1732,12 @@
                  struct half_eye_data *this_half_eye = &heye[vpos[map[k]-1]];
 
                  for (ix = 0; ix < this_half_eye->num_defends; ix++) {
-                   add_vital_eye_move(I(this_half_eye->defense_point[ix]),
-                                      J(this_half_eye->defense_point[ix]), 
-                                      i, j, eye_color);
+                   add_vital_eye_move(this_half_eye->defense_point[ix],
+                                      POS(i, j), eye_color);
                  }
                }
                else {
-                 add_vital_eye_move(I(vpos[map[k]]), J(vpos[map[k]]),
-                                    i, j, eye_color);
+                 add_vital_eye_move(vpos[map[k]], POS(i, j), eye_color);
                }
              }
            }
Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.16
diff -u -r1.16 owl.c
--- engine/owl.c        2001/10/06 20:39:46     1.16
+++ engine/owl.c        2001/10/09 17:58:48
@@ -2582,8 +2582,7 @@
          && (dragon[POS(m, n)].owl_attack_point != NO_MOVE)) {
        if (BOARD(m, n) == color) {
          if (dragon[POS(m, n)].owl_defense_point != NO_MOVE) {
-           add_owl_defense_move(I(dragon[POS(m, n)].owl_defense_point),
-                                J(dragon[POS(m, n)].owl_defense_point), m, n);
+           add_owl_defense_move(dragon[POS(m, n)].owl_defense_point, POS(m, 
n));
            DEBUG(DEBUG_OWL, "owl: %1m defends %m at move %d\n",
                  dragon[POS(m, n)].owl_defense_point, m, n, movenum+1);
          }
@@ -2645,7 +2644,7 @@
          }
          
          /* If we've reached this far, the attack is okay. */
-         add_owl_attack_move(ti, tj, m, n);
+         add_owl_attack_move(POS(ti, tj), POS(m, n));
          DEBUG(DEBUG_OWL, "owl: %m attacks %m at move %d\n", ti, tj, m, n,
                movenum+1);
        }
@@ -2655,38 +2654,33 @@
               && (dragon[POS(m, n)].owl_threat_status == 
CAN_THREATEN_DEFENSE)) {
        if (BOARD(m, n) == color
            && dragon[POS(m, n)].owl_defense_point != NO_MOVE)
-         add_owl_defense_threat_move(I(dragon[POS(m, n)].owl_defense_point),
-                                     J(dragon[POS(m, n)].owl_defense_point),
-                                     m, n) ;
+         add_owl_defense_threat_move(dragon[POS(m, n)].owl_defense_point, 
+                                     POS(m, n)) ;
        if (BOARD(m, n) == color
            && dragon[POS(m, n)].owl_second_defense_point != NO_MOVE
            && is_legal(dragon[POS(m, n)].owl_second_defense_point, color))
-         add_owl_defense_threat_move(I(dragon[POS(m, 
n)].owl_second_defense_point),
-                                     J(dragon[POS(m, 
n)].owl_second_defense_point),
-                                     m, n) ;
+         add_owl_defense_threat_move(dragon[POS(m, 
n)].owl_second_defense_point,
+                                     POS(m, n)) ;
        /* If the opponent can threaten to live, an attacking
         * move gets a small value to make sure it's really dead.
         */
        if ((BOARD(m, n) == OTHER_COLOR(color))
            && (dragon[POS(m, n)].owl_threat_status == CAN_THREATEN_DEFENSE)
            && (dragon[POS(m, n)].owl_attack_point != NO_MOVE))
-         add_owl_prevent_threat_move(I(dragon[POS(m, n)].owl_attack_point),
-                                     J(dragon[POS(m, n)].owl_attack_point),
-                                     m, n);
+         add_owl_prevent_threat_move(dragon[POS(m, n)].owl_attack_point,
+                                     POS(m, n));
       }
       else if (dragon[POS(m, n)].origin == POS(m, n)
               && dragon[POS(m, n)].owl_status == ALIVE
               && BOARD(m, n) == OTHER_COLOR(color)
               && dragon[POS(m, n)].owl_threat_status == CAN_THREATEN_ATTACK) {
        if (dragon[POS(m, n)].owl_attack_point != NO_MOVE)
-         add_owl_attack_threat_move(I(dragon[POS(m, n)].owl_attack_point),
-                                    J(dragon[POS(m, n)].owl_attack_point),
-                                    m, n);
+         add_owl_attack_threat_move(dragon[POS(m, n)].owl_attack_point,
+                                    POS(m, n));
        if (dragon[POS(m, n)].owl_second_attack_point != NO_MOVE
            && is_legal(dragon[POS(m, n)].owl_second_attack_point, color))
-         add_owl_attack_threat_move(I(dragon[POS(m, 
n)].owl_second_attack_point),
-                                    J(dragon[POS(m, 
n)].owl_second_attack_point),
-                                    m, n);
+         add_owl_attack_threat_move(dragon[POS(m, n)].owl_second_attack_point,
+                                    POS(m, n));
       }
       /* The owl code found the friendly dragon alive, but was uncertain,
        * and an extra point of defense was found, so this might
@@ -2698,9 +2692,8 @@
               && !dragon[POS(m, n)].owl_attack_certain
               && dragon[POS(m, n)].owl_defend_certain
               && ON_BOARD(dragon[POS(m, n)].owl_defense_point))
-       add_owl_uncertain_defense_move(I(dragon[POS(m, n)].owl_defense_point),
-                                      J(dragon[POS(m, n)].owl_defense_point),
-                                      m, n);
+       add_owl_uncertain_defense_move(dragon[POS(m, n)].owl_defense_point,
+                                      POS(m, n));
       /* The owl code found the dragon dead, but was uncertain,
        * and an extra point of attack was found, so this might
        * be a good place to play.
@@ -2710,9 +2703,8 @@
               && BOARD(m, n) == OTHER_COLOR(color)
               && !dragon[POS(m, n)].owl_attack_certain
               && ON_BOARD(dragon[POS(m, n)].owl_attack_point))
-       add_owl_uncertain_defense_move(I(dragon[POS(m, n)].owl_attack_point),
-                                      J(dragon[POS(m, n)].owl_attack_point),
-                                      m, n);
+       add_owl_uncertain_defense_move(dragon[POS(m, n)].owl_attack_point,
+                                      POS(m, n));
     }
 }
 
Index: engine/semeai.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/semeai.c,v
retrieving revision 1.11
diff -u -r1.11 semeai.c
--- engine/semeai.c     2001/10/08 16:51:37     1.11
+++ engine/semeai.c     2001/10/09 17:58:57
@@ -193,9 +193,8 @@
     if (dragon[POS(ai, aj)].owl_defense_point != NO_MOVE
        && owl_does_attack(I(dragon[POS(ai, aj)].owl_defense_point),
                           J(dragon[POS(ai, aj)].owl_defense_point), bi, bj)) {
-      add_owl_attack_move(I(dragon[POS(ai, aj)].owl_defense_point),
-                         J(dragon[POS(ai, aj)].owl_defense_point),
-                         bi, bj);
+      add_owl_attack_move(dragon[POS(ai, aj)].owl_defense_point,
+                         POS(bi, bj));
       DEBUG(DEBUG_SEMEAI, "added owl attack of %m at %1m\n",
            bi, bj, dragon[POS(ai, aj)].owl_defense_point);
       owl_code_sufficient = 1;
@@ -215,9 +214,8 @@
     if (dragon[POS(bi, bj)].owl_attack_point != NO_MOVE
        && owl_does_defend(I(dragon[POS(bi, bj)].owl_attack_point),
                           J(dragon[POS(bi, bj)].owl_attack_point), ai, aj)) {
-      add_owl_defense_move(I(dragon[POS(bi, bj)].owl_attack_point),
-                          J(dragon[POS(bi, bj)].owl_attack_point),
-                          ai, aj);
+      add_owl_defense_move(dragon[POS(bi, bj)].owl_attack_point,
+                          POS(ai, aj));
       DEBUG(DEBUG_SEMEAI, "added owl defense of %m at %1m\n",
            ai, aj, dragon[POS(bi, bj)].owl_attack_point);
       if (dragon[POS(ai, aj)].owl_status == DEAD) {
@@ -695,13 +693,13 @@
                             int margin_of_safety)
 {
   if (my_status == CRITICAL)
-    add_semeai_move(ti, tj, ai, aj);
+    add_semeai_move(POS(ti, tj), POS(ai, aj));
   else if (margin_of_safety==1)
-    add_semeai_threat(ti, tj, ai, aj);    
+    add_semeai_threat(POS(ti, tj), POS(ai, aj));
   if (your_status == CRITICAL)
-      add_semeai_move(ti, tj, bi, bj);
+      add_semeai_move(POS(ti, tj), POS(bi, bj));
   else if (margin_of_safety==1)
-    add_semeai_threat(ti, tj, bi, bj);
+    add_semeai_threat(POS(ti, tj), POS(bi, bj));
 }
 
 
Index: engine/shapes.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/shapes.c,v
retrieving revision 1.12
diff -u -r1.12 shapes.c
--- engine/shapes.c     2001/10/02 06:36:02     1.12
+++ engine/shapes.c     2001/10/09 17:59:01
@@ -231,8 +231,8 @@
   if (class & CLASS_B) {
     for (k = 0; k < your_ndragons; k++)
       for (l = k+1; l < your_ndragons; l++) {
-       add_cut_move(ti, tj, your_dragoni[k], your_dragonj[k],
-                    your_dragoni[l], your_dragonj[l]);
+       add_cut_move(POS(ti, tj), POS(your_dragoni[k], your_dragonj[k]),
+                    POS(your_dragoni[l], your_dragonj[l]));
        TRACE("...cuts dragons %m, %m\n", your_dragoni[k], your_dragonj[k],
              your_dragoni[l], your_dragonj[l]);
       }
@@ -242,8 +242,8 @@
   if (class & CLASS_C) {
     for (k = 0; k < my_ndragons; k++)
       for (l = k+1; l < my_ndragons; l++) {
-       add_connection_move(ti, tj, my_dragoni[k], my_dragonj[k],
-                           my_dragoni[l], my_dragonj[l]);
+       add_connection_move(POS(ti, tj), POS(my_dragoni[k], my_dragonj[k]),
+                           POS(my_dragoni[l], my_dragonj[l]));
        TRACE("...connects dragons %m, %m\n", my_dragoni[k], my_dragonj[k],
              my_dragoni[l], my_dragonj[l]);
       }
@@ -257,36 +257,36 @@
    */
   if (class & CLASS_c) {
     for (k = 0; k < my_ndragons; k++) {
-      add_strategical_defense_move(ti, tj, my_dragoni[k], my_dragonj[k]);
+      add_strategical_defense_move(POS(ti, tj), POS(my_dragoni[k], 
my_dragonj[k]));
       TRACE("...strategical defense (weak connection) of %m\n",
            my_dragoni[k], my_dragonj[k]);
     }
-    add_shape_value(ti, tj, 1);
+    add_shape_value(POS(ti, tj), 1);
     TRACE("...shape value 1\n");
   }
 
   /* Pattern class b, block to secure territory. */
   if (class & CLASS_b) {
-    add_block_territory_move(ti, tj);
+    add_block_territory_move(POS(ti, tj));
     TRACE("...blocks territory\n");
   }
 
   /* Pattern class e, expand to make territory. */
   if (class & CLASS_e) {
-    add_expand_territory_move(ti, tj);
+    add_expand_territory_move(POS(ti, tj));
     TRACE("...expands territory\n");
   }
 
   /* Pattern class E, expand to make moyo. */
   if (class & CLASS_E) {
-    add_expand_moyo_move(ti, tj);
+    add_expand_moyo_move(POS(ti, tj));
     TRACE("...expands moyo\n");
   }
 
   /* Pattern class a, strategical level attack on all opponent dragons. */
   if (class & CLASS_a) {
     for (k = 0; k < your_ndragons; k++) {
-      add_strategical_attack_move(ti, tj, your_dragoni[k], your_dragonj[k]);
+      add_strategical_attack_move(POS(ti, tj), POS(your_dragoni[k], 
your_dragonj[k]));
       TRACE("...strategical attack on %m\n", your_dragoni[k], your_dragonj[k]);
     }
   }
@@ -294,7 +294,7 @@
   /* Pattern class d, strategical level defense of all own dragons. */
   if (class & CLASS_d) {
     for (k = 0; k < my_ndragons; k++) {
-      add_strategical_defense_move(ti, tj, my_dragoni[k], my_dragonj[k]);
+      add_strategical_defense_move(POS(ti, tj), POS(my_dragoni[k], 
my_dragonj[k]));
       TRACE("...strategical defense of %m\n", my_dragoni[k], my_dragonj[k]);
     }
   }
@@ -304,11 +304,11 @@
    */
   if (class & CLASS_J) {
     TRACE("...joseki standard move\n");
-    add_expand_territory_move(ti, tj);
+    add_expand_territory_move(POS(ti, tj));
     TRACE("...expands territory\n");
-    add_expand_moyo_move(ti, tj);
+    add_expand_moyo_move(POS(ti, tj));
     TRACE("...expands moyo\n");
-    set_minimum_move_value(ti, tj, 27 * board_size / 19.0);
+    set_minimum_move_value(POS(ti, tj), 27 * board_size / 19.0);
     TRACE("... minimum move value %f\n", 27 * board_size / 19.0);
   }
 
@@ -318,9 +318,9 @@
   if (class & CLASS_j) {
     float fixed_value = 20;
     TRACE("...less urgent joseki move\n");
-    add_expand_territory_move(ti, tj);
+    add_expand_territory_move(POS(ti, tj));
     TRACE("...expands territory\n");
-    add_expand_moyo_move(ti, tj);
+    add_expand_moyo_move(POS(ti, tj));
     TRACE("...expands moyo\n");
 
     /* Board size modification. */
@@ -334,9 +334,9 @@
     else
       TRACE("...move value %f\n", fixed_value);
 
-    set_minimum_move_value(ti, tj, fixed_value);
+    set_minimum_move_value(POS(ti, tj), fixed_value);
     if (board_size >= 17)
-      set_maximum_move_value(ti, tj, fixed_value);
+      set_maximum_move_value(POS(ti, tj), fixed_value);
   }
 
   /* Pattern class t, minor joseki move (tenuki OK). Set the value at 15.
@@ -356,9 +356,9 @@
     else
       TRACE("...move value %f\n", fixed_value);
     
-    set_minimum_move_value(ti, tj, fixed_value);
+    set_minimum_move_value(POS(ti, tj), fixed_value);
     if (board_size >= 17)
-      set_maximum_move_value(ti, tj, fixed_value);
+      set_maximum_move_value(POS(ti, tj), fixed_value);
   }
 
   /* Pattern class U, very urgent move joseki. Add strategical defense
@@ -367,17 +367,17 @@
   if (class & CLASS_U) {
     TRACE("...joseki urgent move\n");
     for (k = 0; k < my_ndragons; k++) {
-      add_strategical_defense_move(ti, tj, my_dragoni[k], my_dragonj[k]);
+      add_strategical_defense_move(POS(ti, tj), POS(my_dragoni[k], 
my_dragonj[k]));
       TRACE("...strategical defense of %m\n", my_dragoni[k], my_dragonj[k]);
     }
     urgent = 1;
     for (k = 0; k < your_ndragons; k++) {
-      add_strategical_attack_move(ti, tj, your_dragoni[k], your_dragonj[k]);
+      add_strategical_attack_move(POS(ti, tj), POS(your_dragoni[k], 
your_dragonj[k]));
       TRACE("...strategical attack on %m\n", your_dragoni[k], your_dragonj[k]);
     }
-    add_shape_value(ti, tj, 15);
+    add_shape_value(POS(ti, tj), 15);
     TRACE("...shape value 15\n");
-    set_minimum_move_value(ti, tj, 40);
+    set_minimum_move_value(POS(ti, tj), 40);
     TRACE("...(min) move value %f\n", 40);
   }
 
@@ -386,43 +386,43 @@
    */
   if (class & CLASS_T) {
     TRACE("...joseki trick move\n");
-    add_antisuji_move(ti, tj);
+    add_antisuji_move(POS(ti, tj));
     TRACE("...antisuji\n");
   }
 
   /* Pattern class W, worthwhile threat move. */
   if (class & CLASS_W) {
     TRACE("...worthwhile threat move\n");
-    add_worthwhile_threat_move(ti, tj);
+    add_worthwhile_threat_move(POS(ti, tj));
   }
 
   /* Minimum move value specified. */
   if (class & VALUE_MINVAL) {
-    set_minimum_move_value(ti, tj, pattern->value);
+    set_minimum_move_value(POS(ti, tj), pattern->value);
     TRACE("...(min) move value %f\n", pattern->value);
   }
 
   /* Maximum move value specified. */
   if (class & VALUE_MAXVAL) {
-    set_maximum_move_value(ti, tj, pattern->maxvalue);
+    set_maximum_move_value(POS(ti, tj), pattern->maxvalue);
     TRACE("...max move value %f\n", pattern->maxvalue);
   }
 
   /* Minimum territorial value specified. */
   if (class & VALUE_MINTERRITORY) {
-    set_minimum_territorial_value(ti, tj, pattern->minterritory);
+    set_minimum_territorial_value(POS(ti, tj), pattern->minterritory);
     TRACE("...(min) territorial value %f\n", pattern->minterritory);
   }
 
   /* Maximum territorial value specified. */
   if (class & VALUE_MAXTERRITORY) {
-    set_maximum_territorial_value(ti, tj, pattern->maxterritory);
+    set_maximum_territorial_value(POS(ti, tj), pattern->maxterritory);
     TRACE("...max territorial value %f\n", pattern->maxterritory);
   }
 
   /* Shape value specified. */
   if (class & VALUE_SHAPE) {
-    add_shape_value(ti, tj, pattern->shape);
+    add_shape_value(POS(ti, tj), pattern->shape);
     TRACE("...shape value %f\n", pattern->shape);
   }
 
Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.16
diff -u -r1.16 utils.c
--- engine/utils.c      2001/10/04 18:38:53     1.16
+++ engine/utils.c      2001/10/09 17:59:18
@@ -93,9 +93,9 @@
   propagate_worm(origin);
 
   if (tpos != 0)
-    add_defense_move(I(tpos), J(tpos), I(origin), J(origin));
+    add_defense_move(tpos, origin);
   else if (dpos != 0)
-    remove_defense_move(I(str), J(str), I(origin), J(origin));
+    remove_defense_move(str, origin);
 }
 
 
@@ -127,9 +127,9 @@
   propagate_worm(origin);
 
   if (tpos != 0)
-    add_attack_move(I(tpos), J(tpos), I(origin), J(origin));
+    add_attack_move(tpos, origin);
   else if (apos != 0)
-    remove_attack_move(I(apos), J(apos), I(origin), J(origin));
+    remove_attack_move(apos, origin);
 }
 
 
Index: engine/worm.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/worm.c,v
retrieving revision 1.12
diff -u -r1.12 worm.c
--- engine/worm.c       2001/10/02 20:15:38     1.12
+++ engine/worm.c       2001/10/09 17:59:32
@@ -342,7 +342,7 @@
                      TRACE("moving point of attack of %1m to %1m\n",
                            pos2, aa);
                      worm[pos2].attack_point = aa;
-                     add_attack_move(I(aa), J(aa), i, j);
+                     add_attack_move(aa, pos2);
                      mi[pos2] = 1;
                    }
                  }
@@ -362,7 +362,7 @@
                            pos2, dd);
                    worm[pos2].defend_code   = WIN;
                    worm[pos2].defense_point = aa;
-                   add_defense_move(I(aa), J(aa), i, j);
+                   add_defense_move(aa, pos2);
                    mi[pos2] = 1;
                  }
                }
@@ -422,7 +422,7 @@
                      TRACE("moving point of attack of %1m to %1m\n",
                            pos2, dd);
                      worm[pos2].attack_point = dd;
-                     add_attack_move(I(dd), J(dd), i, j);
+                     add_attack_move(dd, POS(i, j));
                      mi[pos2] = 1;
                    }
                  }
@@ -442,7 +442,7 @@
                            pos2, dd);
                    worm[pos2].defend_code   = WIN;
                    worm[pos2].defense_point = dd;
-                   add_defense_move(I(dd), J(dd), i, j);
+                   add_defense_move(dd, pos2);
                    mi[pos2] = 1;
                  }
                }
@@ -807,7 +807,7 @@
        TRACE("worm at %m can be attacked at %1m\n", m, n, tpos);
        worm[pos].attack_code = acode;
        worm[pos].attack_point = tpos;
-       add_attack_move(I(tpos), J(tpos), m, n);
+       add_attack_move(tpos, pos);
       }
       propagate_worm(pos);
     }
@@ -836,7 +836,7 @@
          worm[pos].defend_code   = dcode;
          worm[pos].defense_point = tpos;
          if (tpos != NO_MOVE)
-           add_defense_move(I(tpos), J(tpos), m, n);
+           add_defense_move(tpos, pos);
        }
        else {
          /* If the point of attack is not adjacent to the worm, 
@@ -852,7 +852,7 @@
                int change_defense = 0;
                /* FIXME: Include defense code when move 
                 *        is registered. */
-               add_defense_move(I(aa), J(aa), m, n);
+               add_defense_move(aa, pos);
 
                if (acode == 0) {
                  worm[pos].defend_code = WIN;
@@ -936,7 +936,7 @@
                  || (dcode == KO_B && (worm[pos].attack_code == 0
                                        || worm[pos].attack_code == KO_B))
                  || (dcode == KO_A && worm[pos].attack_code == 0))
-               add_attack_move(I(aa), J(aa), m, n);
+               add_attack_move(aa, pos);
            }
            popgo();
          }
@@ -948,7 +948,7 @@
                  || (acode == KO_B && (worm[pos].defend_code == 0
                                        || worm[pos].defend_code == KO_B))
                  || (acode == KO_A && worm[pos].defend_code == 0))
-               add_defense_move(I(aa), J(aa), m, n);
+               add_defense_move(aa, pos);
              popgo();
            }
        }
@@ -1006,7 +1006,7 @@
            if (trymove(aa, other, "threaten attack", pos, EMPTY, NO_MOVE)) {
              /* FIXME: Support ko also. */
              if (attack(pos, NULL) == WIN)
-               add_attack_threat_move(I(aa), J(aa), m, n);
+               add_attack_threat_move(aa, POS(m, n));
              popgo();
            }
 
@@ -1022,7 +1022,7 @@
              if (trymove(bb, other, "threaten attack", pos, EMPTY, NO_MOVE)) {
                /* FIXME: Support ko also. */
                if (attack(pos, NULL) == WIN)
-                 add_attack_threat_move(I(bb), J(bb), m, n);
+                 add_attack_threat_move(bb, POS(m, n));
                popgo();
              }
            }
@@ -1049,7 +1049,7 @@
            /* FIXME: Support ko also. */
            if (attack(pos, NULL) == WIN
                && find_defense(pos, NULL) == WIN)
-             add_defense_threat_move(I(aa), J(aa), m, n);
+             add_defense_threat_move(aa, POS(m, n));
            popgo();
          }
 
@@ -1066,7 +1066,7 @@
              /* FIXME: Support ko also. */
              if (attack(pos, NULL) == WIN
                  && find_defense(pos, NULL) == WIN)
-               add_defense_threat_move(I(bb), J(bb), m, n);
+               add_defense_threat_move(bb, POS(m, n));
              popgo();
            }
          }
@@ -1509,7 +1509,7 @@
       if (countlib(aa) > 4)
        continue;
 
-      if (attack_move_known(ti, tj, I(aa), J(aa)))
+      if (attack_move_known(move, aa))
        continue;
 
       /* No defenses are known at this time, so defend_code is always 0. */
@@ -1559,7 +1559,7 @@
 
        if (dcode != WIN) {
          propagate_worm(aa);
-         add_attack_move(ti, tj, I(aa), J(aa));
+         add_attack_move(move, aa);
        }
       }
     }
@@ -1618,7 +1618,7 @@
       aa = worm[POS(x, y)].origin;
 
       if (worm[aa].attack_code == 0
-         || defense_move_known(ti, tj, I(aa), J(aa)))
+         || defense_move_known(move, aa))
        continue;
       
       /* FIXME: Don't try to defend the same string more than once.
@@ -1655,7 +1655,7 @@
 
        if (acode != WIN) {
          propagate_worm(aa);
-         add_defense_move(ti, tj, I(aa), J(aa));
+         add_defense_move(move, aa);
        }
       }
     }
Index: patterns/helpers.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/helpers.c,v
retrieving revision 1.13
diff -u -r1.13 helpers.c
--- patterns/helpers.c  2001/10/04 18:38:53     1.13
+++ patterns/helpers.c  2001/10/09 17:59:40
@@ -263,7 +263,7 @@
     return 0;
 
   /* Tell the move generation code about the change in status. */
-  remove_lunch(bi, bj, ai, aj);
+  remove_lunch(POS(bi, bj), POS(ai, aj));
   
   if (DRAGON2(bi, bj).lunch == POS(ai, aj))
     DRAGON2(bi, bj).lunch = NO_MOVE;
@@ -606,7 +606,7 @@
   if (TRYMOVE(ai, aj, color)) {
     if (TRYMOVE(bi, bj, other)) {
       if (attack(POS(ci, cj), NULL) && find_defense(POS(ci, cj), &dpos)) {
-       set_minimum_move_value(I(dpos), J(dpos), 0.1);
+       set_minimum_move_value(dpos, 0.1);
        TRACE("%o...setting min move value of %1m to 0.1\n", dpos);
       }
       popgo();
Index: patterns/mkpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.17
diff -u -r1.17 mkpat.c
--- patterns/mkpat.c    2001/10/04 18:38:53     1.17
+++ patterns/mkpat.c    2001/10/09 17:59:56
@@ -218,12 +218,12 @@
   {"owl_topological_eye", 2, "owl_topological_eye(%ci,%cj,BOARD(%ci,%cj))"},
   {"obvious_false_oeye", 1, "obvious_false_eye(%ci,%cj,color)"},
   {"obvious_false_xeye", 1, "obvious_false_eye(%ci,%cj,OTHER_COLOR(color))"},
-  {"antisuji",        1, "add_antisuji_move(%ci,%cj)"},
-  {"add_connect_move",2, "add_connection_move(ti,tj,%ci,%cj,%ci,%cj)"},
-  {"add_cut_move",    2, "add_cut_move(ti,tj,%ci,%cj,%ci,%cj)"},
-  {"add_attack_either_move",2,"add_attack_either_move(ti,tj,%ci,%cj,%ci,%cj)"},
-  {"add_defend_both_move",2, "add_defend_both_move(ti,tj,%ci,%cj,%ci,%cj)"},
-  {"remove_attack",   2, "remove_attack_move(%ci,%cj,%ci,%cj)"},
+  {"antisuji",        1, "add_antisuji_move(POS(%ci,%cj))"},
+  {"add_connect_move",2, 
"add_connection_move(POS(ti,tj),POS(%ci,%cj),POS(%ci,%cj))"},
+  {"add_cut_move",    2, "add_cut_move(POS(ti,tj),POS(%ci,%cj),POS(%ci,%cj))"},
+  
{"add_attack_either_move",2,"add_attack_either_move(POS(ti,tj),POS(%ci,%cj),POS(%ci,%cj))"},
+  {"add_defend_both_move",2, 
"add_defend_both_move(POS(ti,tj),POS(%ci,%cj),POS(%ci,%cj))"},
+  {"remove_attack",   2, "remove_attack_move(POS(%ci,%cj),POS(%ci,%cj))"},
   {"same_dragon",     2, "same_dragon(%ci,%cj,%ci,%cj)"},
   {"same_worm",       2, "same_worm(%ci,%cj,%ci,%cj)"},
   {"dragonsize",      1, "dragon[POS(%ci, %cj)].size"},
@@ -248,7 +248,7 @@
   {"owl_threatens",   2, "owl_threatens_attack(%ci,%cj,%ci,%cj)"},
   {"o_aa_attack",     2, 
"atari_atari_try_combination(color,POS(%ci,%cj),POS(%ci,%cj))"},
   {"x_aa_attack",     2, 
"atari_atari_try_combination(OTHER_COLOR(color),POS(%ci,%cj),POS(%ci,%cj))"},
-  {"replace",         2, "add_replacement_move(%ci,%cj,%ci,%cj)"}
+  {"replace",         2, "add_replacement_move(POS(%ci,%cj),POS(%ci,%cj))"}
 };
 
 



reply via email to

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