qnetdice

changeset 4:7d28bef3fbca tip

ops, forgot to add +1 to random numbers in roll.cc to make them 1-based
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 23 Dec 2013 17:40:34 +0200
parents 2e57c80653af
children
files src/roll.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/src/roll.cc	Mon Dec 23 06:09:25 2013 +0200
     1.2 +++ b/src/roll.cc	Mon Dec 23 17:40:34 2013 +0200
     1.3 @@ -40,6 +40,6 @@
     1.4  
     1.5  int Roll::roll()
     1.6  {
     1.7 -	value = (int)floor((double)sides * (double)rand() / (double)RAND_MAX);
     1.8 +	value = (int)floor((double)sides * (double)rand() / (double)RAND_MAX) + 1;
     1.9  	return value;
    1.10  }