Rand.Int Command and Subtracting Arrays
Author |
Message |
fear01
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Thu Dec 01, 2005 9:31 pm Post subject: (No 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:
code: | 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] |
|
|
|
|
![](images/spacer.gif) |
|
|