summaryrefslogtreecommitdiff
path: root/noncore/games/go/killable.c
Unidiff
Diffstat (limited to 'noncore/games/go/killable.c') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/go/killable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/go/killable.c b/noncore/games/go/killable.c
index 3ed2d2e..23a133d 100644
--- a/noncore/games/go/killable.c
+++ b/noncore/games/go/killable.c
@@ -41,49 +41,49 @@ short x, y;
41 41
42short killTree(tx, ty, gx, gy, escape, tkMark) 42short killTree(tx, ty, gx, gy, escape, tkMark)
43short tx, ty, gx, gy, *escape, tkMark; 43short tx, ty, gx, gy, *escape, tkMark;
44 { /* killTree */ 44 { /* killTree */
45 short curMark, mark2, mark3, i, j, k, tl, dStart, result; 45 short curMark, mark2, mark3, i, j, k, tl, dStart, result;
46 sPointList lList1, lList2; 46 sPointList lList1, lList2;
47 short libList[maxSPoint+1]; 47 short libList[maxSPoint+1];
48 point tp; 48 point tp;
49 short esc = FALSE; 49 short esc = FALSE;
50 tryCount = tryCount + 1; 50 tryCount = tryCount + 1;
51 if (tryCount > tryLimit) 51 if (tryCount > tryLimit)
52 { 52 {
53 undoTo(tkMark); 53 undoTo(tkMark);
54/* for (i = 1; i <= depth - 1; i++) 54/* for (i = 1; i <= depth - 1; i++)
55 { 55 {
56 sClearChar(sChar, rXor); 56 sClearChar(sChar, rXor);
57 } */ 57 } */
58 depth = 1; 58 depth = 1;
59 return FALSE; 59 return FALSE;
60 } 60 }
61/* write(sChar); */ 61/* write(sChar); */
62 depth = depth + 1; 62 depth = depth + 1;
63 curMark = playMark; 63 curMark = playMark;
64 tryPlay(tx, ty, me); /* try my move */ 64 tryPlay(tx, ty, me); /* try my move */
65 pause(); 65// pause();
66 if (gList[gMap[groupIDs[tx][ty]]].libC == 0) /* I'm dead */ 66 if (gList[gMap[groupIDs[tx][ty]]].libC == 0) /* I'm dead */
67 { 67 {
68 result = FALSE; 68 result = FALSE;
69 goto one; 69 goto one;
70 } 70 }
71 else if (killFlag) /* I killed something of his */ 71 else if (killFlag) /* I killed something of his */
72 { 72 {
73 result = TRUE; 73 result = TRUE;
74 goto one; 74 goto one;
75 } 75 }
76 else if (gList[gMap[groupIDs[gx][gy]]].libC > treeLibLim) /* safe */ 76 else if (gList[gMap[groupIDs[gx][gy]]].libC > treeLibLim) /* safe */
77 { 77 {
78 result = FALSE; 78 result = FALSE;
79 goto one; 79 goto one;
80 } 80 }
81 else 81 else
82 { 82 {
83 sSpanGroup(gx, gy, &lList1); /* find his liberties */ 83 sSpanGroup(gx, gy, &lList1); /* find his liberties */
84 if (gList[gMap[groupIDs[tx][ty]]].libC == 1) /* he can kill me */ 84 if (gList[gMap[groupIDs[tx][ty]]].libC == 1) /* he can kill me */
85 { 85 {
86 if (lList1.indx < maxSPoint) /* add that option to his list */ 86 if (lList1.indx < maxSPoint) /* add that option to his list */
87 { 87 {
88 lList1.indx = lList1.indx + 1; 88 lList1.indx = lList1.indx + 1;
89 spanGroup(tx, ty, &plist2); /* find my liberty */ 89 spanGroup(tx, ty, &plist2); /* find my liberty */
@@ -131,49 +131,49 @@ short tx, ty, gx, gy, *escape, tkMark;
131 *escape = TRUE; 131 *escape = TRUE;
132 result = FALSE; 132 result = FALSE;
133 goto one; 133 goto one;
134 } 134 }
135 undoTo(mark2); 135 undoTo(mark2);
136 } 136 }
137 for (i = 1; i <= lList1.indx - 1; i++) 137 for (i = 1; i <= lList1.indx - 1; i++)
138 for (j = i + 1; j <= lList1.indx; j++) 138 for (j = i + 1; j <= lList1.indx; j++)
139 if (libList[i] < libList[j]) 139 if (libList[i] < libList[j])
140 { 140 {
141 tl = libList[i]; 141 tl = libList[i];
142 libList[i] = libList[j]; 142 libList[i] = libList[j];
143 libList[j] = tl; 143 libList[j] = tl;
144 tp = lList1.p[i]; 144 tp = lList1.p[i];
145 lList1.p[i] = lList1.p[j]; 145 lList1.p[i] = lList1.p[j];
146 lList1.p[j] = tp; 146 lList1.p[j] = tp;
147 } 147 }
148 } 148 }
149 for (i = 1; i <= lList1.indx + 1; i++) /* try his responses */ 149 for (i = 1; i <= lList1.indx + 1; i++) /* try his responses */
150 { 150 {
151 mark2 = playMark; 151 mark2 = playMark;
152 if (i <= lList1.indx) /* try his move */ 152 if (i <= lList1.indx) /* try his move */
153 { 153 {
154 tryPlay(lList1.p[i].px, lList1.p[i].py, him); /* play his response */ 154 tryPlay(lList1.p[i].px, lList1.p[i].py, him); /* play his response */
155 pause(); 155// pause();
156 if (gList[gMap[groupIDs[lList1.p[i].px] 156 if (gList[gMap[groupIDs[lList1.p[i].px]
157 [lList1.p[i].py]]].libC < 2) 157 [lList1.p[i].py]]].libC < 2)
158 goto two; /* a bogus move */ 158 goto two; /* a bogus move */
159 } 159 }
160 else if (gList[gMap[groupIDs[gx][gy]]].libC <= 1) 160 else if (gList[gMap[groupIDs[gx][gy]]].libC <= 1)
161 { 161 {
162 result = TRUE; 162 result = TRUE;
163 goto one; 163 goto one;
164 } 164 }
165 if (gList[gMap[groupIDs[gx][gy]]].libC > treeLibLim) 165 if (gList[gMap[groupIDs[gx][gy]]].libC > treeLibLim)
166 { 166 {
167 *escape = TRUE; 167 *escape = TRUE;
168 result = FALSE; 168 result = FALSE;
169 goto one; 169 goto one;
170 } 170 }
171 if (gList[gMap[groupIDs[gx][gy]]].libC > 1) 171 if (gList[gMap[groupIDs[gx][gy]]].libC > 1)
172 { /* look at my responses */ 172 { /* look at my responses */
173 sSpanGroup(gx, gy, &lList2); /* list his liberties */ 173 sSpanGroup(gx, gy, &lList2); /* list his liberties */
174 dStart = lList2.indx + 1; 174 dStart = lList2.indx + 1;
175 if (adjInAtari) /* he wins */ 175 if (adjInAtari) /* he wins */
176 { 176 {
177 result = FALSE; 177 result = FALSE;
178 goto one; 178 goto one;
179 } 179 }