Woah this is really important!
Posted: Thu Jan 20, 2005 8:39 pm
If you have a program that randomly selects say 5 words from a list of 20 or w/e how do you errortrap it or w/e so that the same word is not picked twice?
Thanks so much!
<3
Ps. This is my friends thing and this is her code for it I can't really explain it but here it is if it helps.
var num : int
var Tim3 : int := 1
var words : array 1 .. 20 of string (15) := init ("1)Amazing", "2)Banana", "3)Cherries", "4)Dance", "5)Elephant", "6)Fantastic", "7)Game", "8)Ice", "9)Kangaroo", "10)Love", "11)Marshmallow","12)Octopus", "13)Pig", "14)Rainbow", "15)Strawberries", "16)Turtle", "17)Umbrella","18)Violin","19)Xylophone","20)Wiggle")
for x : 1 .. 10
Tim3 := Tim3 + 1
randint (num, 1, 20)
put words (num)
delay (1000)
exit when Tim3 = 11
end for
Archived topic from Iceteks, old topic ID:3038, old post ID:24964
Thanks so much!
<3
Ps. This is my friends thing and this is her code for it I can't really explain it but here it is if it helps.
var num : int
var Tim3 : int := 1
var words : array 1 .. 20 of string (15) := init ("1)Amazing", "2)Banana", "3)Cherries", "4)Dance", "5)Elephant", "6)Fantastic", "7)Game", "8)Ice", "9)Kangaroo", "10)Love", "11)Marshmallow","12)Octopus", "13)Pig", "14)Rainbow", "15)Strawberries", "16)Turtle", "17)Umbrella","18)Violin","19)Xylophone","20)Wiggle")
for x : 1 .. 10
Tim3 := Tim3 + 1
randint (num, 1, 20)
put words (num)
delay (1000)
exit when Tim3 = 11
end for
Archived topic from Iceteks, old topic ID:3038, old post ID:24964