I'm making a dice program that calculates the statistics such as actual percentage, expected rolls and expected percentage and so on. I'm having a difficulty on the Pseudo random number generation. With two dice, the mim. sum of the dice is 2, not 1. There is something wrong with my code so it keep generating the number 1 out.
Can anyone help me with that?
cout << "Enter seed: ";
cin >> seed;
cout << "Number of repeats: ";
cin >> intRepeats;
x = seed; //x is the PRN, and the first is user selected
for (int i = 0; i < intRepeats; i++)
{
x = ((multiplies * x) + inciement) % modulus; //CREATE A RANDOM NUMBER
num = x / float (modulus);
roll = int (num * 12) +1;
cout << "Dice roll was: " << roll << endl;
test++;
frequency[(roll)]++;
[img] http://images.plurk.com/41fc82bc186ee5987fdfd4fcc78bc837.jpg [/img]