Todd C. Miller:
> Looks good but I think this idiom used in hangman:
>
> pos = (double) random() / (RAND_MAX + 1.0) * (double) Dict_size;
>
> Can be replaced with:
>
> pos = arc4random_uniform(Dict_size);
>
> so long as Dict_size <= UINT32_MAX, which should always be the case.
Hmm. D
Looks good but I think this idiom used in hangman:
pos = (double) random() / (RAND_MAX + 1.0) * (double) Dict_size;
Can be replaced with:
pos = arc4random_uniform(Dict_size);
so long as Dict_size <= UINT32_MAX, which should always be the case.
A similar idiom is used by monop (compare
This replaces srandomdev()+random() with calls to arc4random*() in
src/games. There isn't much practical benefit to this. Consider
it a style fix.
I have NOT touched the games that call srandom() with a particular seed
for deterministic gameplay.
Index: arithmetic/arithmetic.c
=