Index: engine/dragon.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v retrieving revision 1.68 diff -u -r1.68 dragon.c --- engine/dragon.c 6 Aug 2002 19:04:11 -0000 1.68 +++ engine/dragon.c 8 Aug 2002 23:01:01 -0000 @@ -1661,18 +1661,18 @@ static float compute_dragon_weakness_value(int d) { - float true_genus = ((float) dragon2[d].genus) - + 0.5 * ((float) dragon2[d].heyes - + (dragon2[d].lunch != NO_MOVE ? 1.0 : 0.0)); + float true_genus = (((float) dragon2[d].genus) + + 0.5 * ((float) dragon2[d].heyes + + (dragon2[d].lunch != NO_MOVE ? 1.0 : 0.0))); int origin = dragon2[d].origin; float escape_route = (float) dragon2[d].escape_route; int dragon_safety = dragon2[d].safety; - int i,j; + int i, j; float weakness_value[3]; float weakness; - if (dragon_safety == INVINCIBLE|| dragon_safety == INESSENTIAL) + if (dragon_safety == INVINCIBLE || dragon_safety == INESSENTIAL) return 0.0; if (dragon_safety == TACTICALLY_DEAD) return 1.0; @@ -1705,7 +1705,8 @@ weakness_value[2] = gg_interpolate(&genus2weakness, true_genus); DEBUG(DEBUG_DRAGONS, "Computing weakness of dragon at %1m:\n", origin); - DEBUG(DEBUG_DRAGONS, " moyo value %f -> %f, escape %f -> %f, eyes %f -> %f,", + DEBUG(DEBUG_DRAGONS, + " moyo value %f -> %f, escape %f -> %f, eyes %f -> %f,", dragon2[d].moyo_territorial_value, weakness_value[0], escape_route, weakness_value[1], true_genus, weakness_value[2]); @@ -1752,8 +1753,10 @@ /* Compute the surrounding moyo sizes. */ for (d = 0; d < number_of_dragons; d++) dragon2[d].moyo_size_post_owl = 2 * BOARDMAX; + /* Set moyo sizes according to initial_influence. */ compute_surrounding_moyo_sizes(0, 1); + /* Set moyo sizes according to initial_opposite_influence if * this yields smaller results. */ @@ -1876,52 +1879,54 @@ return; } - gfprintf(outfile,"color %s\n", color_to_string(d->color)); - gfprintf(outfile,"origin %1m\n", d->origin); - gfprintf(outfile,"size %d\n", d->size); - gfprintf(outfile,"effective_size %f\n", d->effective_size); - gfprintf(outfile,"heyes %d\n", d2->heyes); - gfprintf(outfile,"heye %1m\n", d2->heye); - gfprintf(outfile,"genus %d\n", d2->genus); - gfprintf(outfile,"escape_route %d\n", d2->escape_route); - gfprintf(outfile,"lunch %1m\n", d2->lunch); - gfprintf(outfile,"status %s\n", + gfprintf(outfile, "color %s\n", color_to_string(d->color)); + gfprintf(outfile, "origin %1m\n", d->origin); + gfprintf(outfile, "size %d\n", d->size); + gfprintf(outfile, "effective_size %f\n", d->effective_size); + gfprintf(outfile, "heyes %d\n", d2->heyes); + gfprintf(outfile, "heye %1m\n", d2->heye); + gfprintf(outfile, "genus %d\n", d2->genus); + gfprintf(outfile, "escape_route %d\n", d2->escape_route); + gfprintf(outfile, "lunch %1m\n", d2->lunch); + gfprintf(outfile, "status %s\n", status_to_string(d->crude_status)); - gfprintf(outfile,"owl_status %s\n", + gfprintf(outfile, "owl_status %s\n", status_to_string(d->owl_status)); - gfprintf(outfile,"status %s\n", + gfprintf(outfile, "status %s\n", status_to_string(d->status)); - gfprintf(outfile,"owl_threat_status %s\n", + gfprintf(outfile, "owl_threat_status %s\n", status_to_string(d->owl_threat_status)); - gfprintf(outfile,"owl_attack %1m\n", d->owl_attack_point); - gfprintf(outfile,"owl_attack_certain %s\n", + gfprintf(outfile, "owl_attack %1m\n", d->owl_attack_point); + gfprintf(outfile, "owl_attack_certain %s\n", (d->owl_attack_certain) ? "YES" : "NO"); - gfprintf(outfile,"owl_2nd_attack %1m\n", d->owl_second_attack_point); - gfprintf(outfile,"owl_defend %1m\n", d->owl_defense_point); - gfprintf(outfile,"owl_defense_certain %s\n", + gfprintf(outfile, "owl_2nd_attack %1m\n", + d->owl_second_attack_point); + gfprintf(outfile, "owl_defend %1m\n", d->owl_defense_point); + gfprintf(outfile, "owl_defense_certain %s\n", (d->owl_defense_certain) ? "YES" : "NO"); - gfprintf(outfile,"owl_2nd_defend %1m\n", + gfprintf(outfile, "owl_2nd_defend %1m\n", d->owl_second_defense_point); - gfprintf(outfile,"semeai %d\n", d2->semeai); - gfprintf(outfile,"semeai_margin_of_safety %d\n", + gfprintf(outfile, "semeai %d\n", d2->semeai); + gfprintf(outfile, "semeai_margin_of_safety %d\n", d2->semeai_margin_of_safety); - gfprintf(outfile,"neighbors "); + gfprintf(outfile, "neighbors "); for (k = 0; k < d2->neighbors; k++) - gfprintf(outfile,"%1m ", DRAGON(d2->adjacent[k]).origin); - gfprintf(outfile,"\nhostile neighbors %d\n", d2->hostile_neighbors); - gfprintf(outfile,"moyo size pre owl %d\n", d2->moyo_size_pre_owl); - gfprintf(outfile,"moyo size post owl %d\n", d2->moyo_size_post_owl); - gfprintf(outfile,"moyo territorial value %f\n", d2->moyo_territorial_value); - gfprintf(outfile,"safety %s\n", + gfprintf(outfile, "%1m ", DRAGON(d2->adjacent[k]).origin); + gfprintf(outfile, "\nhostile neighbors %d\n", d2->hostile_neighbors); + gfprintf(outfile, "moyo size pre owl %d\n", d2->moyo_size_pre_owl); + gfprintf(outfile, "moyo size post owl %d\n", d2->moyo_size_post_owl); + gfprintf(outfile, "moyo territorial value %f\n", + d2->moyo_territorial_value); + gfprintf(outfile, "safety %s\n", safety_to_string(d2->safety)); - gfprintf(outfile,"weakness estimate %f\n", d2->weakness); - gfprintf(outfile,"strings "); + gfprintf(outfile, "weakness estimate %f\n", d2->weakness); + gfprintf(outfile, "strings "); for (ii = BOARDMIN; ii < BOARDMAX; ii++) if (ON_BOARD(ii) && worm[ii].origin == ii && is_same_dragon(ii, pos)) - gfprintf(outfile,"%1m ", ii); - gfprintf(outfile,"\n"); + gfprintf(outfile, "%1m ", ii); + gfprintf(outfile, "\n"); } Index: engine/influence.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v retrieving revision 1.58 diff -u -r1.58 influence.c --- engine/influence.c 27 Jun 2002 18:28:04 -0000 1.58 +++ engine/influence.c 8 Aug 2002 23:01:03 -0000 @@ -1357,7 +1357,7 @@ * for the color playing it. Ideally this should never happen, but * currently we need this workaround. */ - if (ON_BOARD2(m,n)) { + if (ON_BOARD2(m, n)) { if (color == BLACK && q->territory_value[m][n] < 0.0) q->territory_value[m][n] = 0.0; else if (color == WHITE && q->territory_value[m][n] > 0.0) Index: engine/interface.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/interface.c,v retrieving revision 1.22 diff -u -r1.22 interface.c --- engine/interface.c 15 Jun 2002 21:35:53 -0000 1.22 +++ engine/interface.c 8 Aug 2002 23:01:04 -0000 @@ -605,7 +605,7 @@ } rotate(i, j, &i, &j, board_size, orientation); - if ((ON_BOARD2(i,j) && board[POS(i, j)] == EMPTY) + if ((ON_BOARD2(i, j) && board[POS(i, j)] == EMPTY) || (i == -1 && j == -1)) { gnugo_play_move(i, j, next); sgffile_move_made(i, j, next, 0); Index: engine/owl.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v retrieving revision 1.97 diff -u -r1.97 owl.c --- engine/owl.c 6 Aug 2002 19:04:11 -0000 1.97 +++ engine/owl.c 8 Aug 2002 23:01:08 -0000 @@ -1351,7 +1351,7 @@ shape_moves[0].value = 25; shape_moves[0].name = "tactical attack"; shape_moves[0].same_dragon = 1; - shape_moves[0].escape = 0; + shape_moves[0].escape = 0; shape_moves[1].value = 0; moves = shape_moves; } @@ -2700,7 +2700,7 @@ /* The very first check is whether we can disregard the pattern due * due to an owl safe_move_cache lookup. */ - if (! (pattern->class & CLASS_s)) + if (!(pattern->class & CLASS_s)) if (current_owl_data->safe_move_cache[move]) { if (current_owl_data->safe_move_cache[move] == 1) return 0; @@ -2710,7 +2710,7 @@ /* If the constraint is cheap to check, we do this first. */ if ((pattern->autohelper_flag & HAVE_CONSTRAINT) - && (pattern->constraint_cost < 0.45)) { + && pattern->constraint_cost < 0.45) { if (!pattern->autohelper(pattern, ll, move, color, 0)) return 0; constraint_checked = 1; @@ -2720,7 +2720,7 @@ * not checked. Otherwise we discard moves which can be captured. * Illegal ko captures are accepted for ko analysis. */ - if ((!(pattern->class & CLASS_s)) && (!safe_move_checked)) { + if (!(pattern->class & CLASS_s) && !safe_move_checked) { if (!owl_safe_move(move, color)) { if (0) TRACE(" move at %1m wasn't safe, discarded\n", move); @@ -2749,7 +2749,7 @@ /* If the pattern has a constraint, call the autohelper to see * if the pattern must be rejected. */ - if (pattern->autohelper_flag & HAVE_CONSTRAINT && (!constraint_checked)) + if ((pattern->autohelper_flag & HAVE_CONSTRAINT) && !constraint_checked) if (!pattern->autohelper(pattern, ll, move, color, 0)) return 0; return 1; Index: engine/value_moves.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v retrieving revision 1.45 diff -u -r1.45 value_moves.c --- engine/value_moves.c 6 Aug 2002 19:04:11 -0000 1.45 +++ engine/value_moves.c 8 Aug 2002 23:01:14 -0000 @@ -772,7 +772,7 @@ /* * Returns the pre-computed weakness of a dragon, with corrections - * according to ignore_dead_draggons. + * according to ignore_dead_dragons. * * FIXME: Important to test more exactly how effective a strategical * attack or defense of a weak dragon is. This can be done by Index: utils/gg_utils.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/utils/gg_utils.c,v retrieving revision 1.26 diff -u -r1.26 gg_utils.c --- utils/gg_utils.c 19 Jun 2002 22:30:04 -0000 1.26 +++ utils/gg_utils.c 8 Aug 2002 23:01:18 -0000 @@ -395,7 +395,7 @@ } while (gap > 1 || swap_made); } -/* Linearly interpoloate f(x) from the data given in interpolation_data. */ +/* Linearly interpolate f(x) from the data given in interpolation_data. */ float gg_interpolate(struct interpolation_data *f, float x) { @@ -410,9 +410,11 @@ ratio = ((float) f->sections) * (x - f->range_lowerbound) /(f->range_upperbound - f->range_lowerbound); i = (int) ratio; - diff = ratio - ((float)i); - /* printf(stderr, "Floating point Ratio: %f, integer: %d, diff %f", ratio, i, diff); */ - return ((1-diff)*f->values[i] + diff* f->values[i+1]); + diff = ratio - ((float) i); + if (0) + fprintf(stderr, "Floating point Ratio: %f, integer: %d, diff %f", + ratio, i, diff); + return ((1 - diff) * f->values[i] + diff * f->values[i+1]); } }