12 probdist_pick(struct probdist
*pd
, int *ignore
)
14 double total
= probdist_total(pd
) - PROBDIST_EPSILON
;
16 double stab
= fast_frandom() * total
;
17 //fprintf(stderr, "stab %f / %f\n", stab, total);
18 for (int i
= 0; i
< pd
->n
; i
++) {
19 //struct board b = { .size = 11 };
20 //fprintf(stderr, "[%s] %f (%f)\n", coord2sstr(i, &b), pd->items[i], stab);
21 if (*ignore
&& i
== *ignore
) {
25 if (stab
<= pd
->items
[i
])
29 fprintf(stderr
, "overstab %f (total %f)\n", stab
, total
);