Computer Science Canada Rand.Int Command and Subtracting Arrays |
Author: | fear01 [ Thu Dec 01, 2005 9:12 pm ] |
Post subject: | Rand.Int Command and Subtracting Arrays |
Uh could some explain how the Rand.Int command works? I have looked at the helped and tried it out myself but it says that the variable is of the wrong type. I am making a sort of trivia game and was wondering if, when a user answers a question correctly, how can i subtract that question out of the loop so it won't appear again? Thanks for the help. |
Author: | [Gandalf] [ Thu Dec 01, 2005 9:31 pm ] | ||
Post subject: | |||
Rand.Int() works by taking two parameters, the lower number and the higher number (limits). Since it is a function, you have to "do" something with it, like outputting it or assigning it to a variable. You are most likely getting "wrong variable type" because you are not using an int to store the randomized number, ie:
will generate a random number from 1 to 10. As for deleting questions, look up arrays and store all the unanswered (or answered, your choice) questions in it.[/code] |