From 2099ce34476121e325e5a9755e9a81384c1cc0c9 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 13 Feb 2011 15:52:17 +0100 Subject: [PATCH] uct_playout(): Remove superfluous depth variable --- uct/walk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uct/walk.c b/uct/walk.c index b657e72..37878f5 100644 --- a/uct/walk.c +++ b/uct/walk.c @@ -286,14 +286,13 @@ uct_playout(struct uct *u, struct board *b, enum stone player_color, struct tree int passes = is_pass(b->last_move.coord) && b->moves > 0; /* debug */ - int depth = 0; static char spaces[] = "\0 "; /* /debug */ if (UDEBUGL(8)) fprintf(stderr, "--- UCT walk with color %d\n", player_color); while (!tree_leaf_node(n) && passes < 2) { - spaces[depth++] = ' '; spaces[depth] = 0; + spaces[dlen - 1] = ' '; spaces[dlen] = 0; /*** Choose a node to descend to: */ @@ -423,7 +422,7 @@ uct_playout(struct uct *u, struct board *b, enum stone player_color, struct tree int pval = LTREE_PLAYOUTS_MULTIPLIER; if (u->local_tree && u->local_tree_depth_decay > 0) - pval = ((floating_t) pval) / pow(u->local_tree_depth_decay, depth); + pval = ((floating_t) pval) / pow(u->local_tree_depth_decay, dlen); if (t->use_extra_komi) { stats_add_result(&u->dynkomi->score, result / 2, 1); -- 2.11.4.GIT