From 301f7477f12789f91292676112b854e422d8c1a2 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 2 Jul 2010 16:22:26 +0200 Subject: [PATCH] Probdist: Add debug prints --- probdist.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/probdist.c b/probdist.c index 2e15ecf..bd932ab 100644 --- a/probdist.c +++ b/probdist.c @@ -3,6 +3,8 @@ #include #include +//#define DEBUG +#include "debug.h" #include "move.h" #include "probdist.h" #include "random.h" @@ -14,7 +16,8 @@ probdist_pick(struct probdist *pd, coord_t *ignore) double total = probdist_total(pd) - PROBDIST_EPSILON; assert(total >= 0); double stab = fast_frandom() * total; - //fprintf(stderr, "stab %f / %f\n", stab, total); + if (DEBUGL(6)) + fprintf(stderr, "stab %f / %f\n", stab, total); int r = 0; while (stab > pd->rowtotals[r] + PROBDIST_EPSILON) { @@ -23,7 +26,8 @@ probdist_pick(struct probdist *pd, coord_t *ignore) assert(r < board_size(pd->b)); } for (coord_t c = r * board_size(pd->b); c < board_size2(pd->b); c++) { - //fprintf(stderr, "[%s] %f (%f)\n", coord2sstr(c, &pd->b), pd->items[c], stab); + if (DEBUGL(6)) + fprintf(stderr, "[%s] %f (%f)\n", coord2sstr(c, pd->b), pd->items[c], stab); if (c == *ignore) { ignore++; continue; -- 2.11.4.GIT