Problem with Random
RUPAS
Member Posts: 823
hi all, I have a small problem with the random, I'm making a game with boards, a trivial, I have 200 questions and random, the probability of a recurrence is 0.00025 and yet are repeated a lot, do not understand, there is some how to improve this problem?
Comments
That way you avoid things like, if you start a level twice, the first thing you seed being the same.
I have this rule:
"change atribute game.whatquestion to random(1,tablerowcount(game.TBPACKQUESTION)"
is correct?
this pack contains 200 questions, but repeats much,
some help?
random(1, game.milliseconds)%tablerowcount(game.TBPACKQUESTION)
That way you are getting a random from the game timer which is all over the place, then the % allows you to constrain it to how many questions you have. Like 200 for example.
If you just make a test game with a blank square that shows the results of that formula, and have it do that whenever you click it, you'll probably see some really random selections.
create/import the original table
create a blank Table for runTime usage
gameAttribute: index type … name: what? … this will be your row #
Copy Table behavior … original to temp
use the Add/Remove behavior to delete used rows in the temp table
demo: http://www.mediafire.com/?48p8lxzho7kgrm2
MH
for restart or replay have a button that changes the what? to 0
then copies the original to temp
MH