I'm trying to make a simple randomizer program for a high school classroom. What it is supposed to do is simply tell each of 8 groups of students which group goes first, then second, then third, all the way to the eighth group.
I know this has to be a very simple thing to do but the portion of the code I can't figure out is how to deal with a range of broken numbers. I'll post a part of the code below and then explain what I mean by broken numbers:
Code: Select all
put random (8) into tNumberPick
put word tNumberPick of field "numberField" into tChoice8
repeat
if tNumberPick = tChoice1 or tChoice2 or tChoice3 or tChoice4 or tChoice5 or tChoice6 or tChoice7 then
put random (8) into tNumberPick
else
put tNumberPick into field "eighthField"
exit repeat
end if
end repeat
put tNumberPick into tChoice8
wait 60 ticks
I'm doing random(8) because I need it to pick from 1 to 8 for the group numbers. What I mean by using a "broken range" is that the program needs to know what numbers have already been placed in each of the local variables.
I know the above code doesn't work using "tChoice1 or tChoce2" etc., so I'm assuming that "or" is not the correct expression. So my real question is how do I tell it to look for more than one number at a time when those numbers aren't in a normal low-to-high range? In other words, how would I tell it to be able to recognize "1 or 3 or 5 or 8" all at the same time in an if-then-else expression?
Thanks to whoever can tell me how to accomplish this task.
Cheers, deeverd