rrocks1241
03-14-2008, 02:03 AM
I have a program that I have to complete where it's basically a guessing game.
Alice picks a random number from 1 to 40,
then the user is asked to pick a number, to try to match the random one.
If the number is too high, it will say "Too high"
if the number is too low, it will say "too low"
if the number is the same as random, then it will let the user know as such.
However, my problem is that sometimes the random number will be a decimal.
Like, I will choose 8 and it will be too low, and if I choose 9 it will say "too high".
I have tried setting the variable "RandomNumber" as (ceiling(randomnumber[minimum=0][maximum=5]integerOnly=true)
I have tried with the integer false.
I have tried with the floor function.
I have tried with the round function.
I have also tried just setting:
(RandomNumber[min=0][max=40])
and then I would do
(RandomNumber set value to (ceiling(RandomNumber)))
and I would try with floor and round as well...
none of these have worked!
I have tested so many times, and I'm just stumped.
thanks so much for your time,
-rrocks
Alice picks a random number from 1 to 40,
then the user is asked to pick a number, to try to match the random one.
If the number is too high, it will say "Too high"
if the number is too low, it will say "too low"
if the number is the same as random, then it will let the user know as such.
However, my problem is that sometimes the random number will be a decimal.
Like, I will choose 8 and it will be too low, and if I choose 9 it will say "too high".
I have tried setting the variable "RandomNumber" as (ceiling(randomnumber[minimum=0][maximum=5]integerOnly=true)
I have tried with the integer false.
I have tried with the floor function.
I have tried with the round function.
I have also tried just setting:
(RandomNumber[min=0][max=40])
and then I would do
(RandomNumber set value to (ceiling(RandomNumber)))
and I would try with floor and round as well...
none of these have worked!
I have tested so many times, and I'm just stumped.
thanks so much for your time,
-rrocks