Posted By: felixfx
using random() - 11/13/19 02:11
hi, I'm testing the random number generator and I cannot seem to get random(1); to have an output other than zero.
I may be utilizing it incorrectly. The zorro.chm file saids
random(var max): var // suppose to return a number between 0 and max
my code looks like this:
function run()
{
int number = random(1);
if (number == 0) printf("\nZero");
if (number == 1) printf("\nOne");
}
Any ideas? Thanks!
I may be utilizing it incorrectly. The zorro.chm file saids
random(var max): var // suppose to return a number between 0 and max
my code looks like this:
function run()
{
int number = random(1);
if (number == 0) printf("\nZero");
if (number == 1) printf("\nOne");
}
Any ideas? Thanks!