
-----------------------------------
fear01
Thu Dec 01, 2005 9:12 pm

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.

-----------------------------------
[Gandalf]
Thu Dec 01, 2005 9:31 pm


-----------------------------------
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:
var randomNumber : int := Rand.Int (1, 10)
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]
