Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: Random Questions Without Repeating |
From: | Nathan Dicken |
Date: | Tue, 25 Jul 2000 22:44:33 +0100 |
Hi Paul,
Here's a technique that you could use - esentially you build a string
"list" to hold values for your questions and you use and take away values
from that list. The example below uses a list of 10 questions (you have
30) for your reference. The digits variable is used for the string length
of your largest number (e.g. 10 - 2 digits).
Set Variable: "qList" = "01020304050607080910"
Set Variable: "digits" = "2"
Loop While (length(qList) > 0)
Set Variable: "rValue" = random( length(qList) / digits ) + 1
Set Variable: "qValue" = int(subString( qList,
((rValue*digits)-(digits-1)), digits ))
Comment: act upon this qValue, or...
Comment: create a new random list with it in non-integer form...
Comment: ---------------------------------------
Comment: finally, reform the "qList"...
Set Variable: "prevList" = subString( qList, 1, ((rValue-1)*digits) )
Set Variable: "postList" = subString( qList, ( ((rValue+1)*digits) -
(digits-1)), (length(qList)-(rValue*digits)) )
Set Variable: "qList" = prevList & postList
End Loop
Try this out - it should resemble more like how you'd do it in Director.
Nathan
-------------------------
Nathan Dicken
Boxerjam Inc.
nathandboxerjam [dot] com
www.boxerjam.com
>I am making a quiz where there are 30 questions. I want to randomly choose a
>question and ask it then remove it from the question pool. I normally have
>no problem doing this sort of stuff in Director - I simply create a list of
>the question numbers and remove the question number from the list after
>asking the question - but I can't figure out how do do it in Flash - am I
>being really dumb?! The only way I can think of is have 30 variables i.e
>Question1_Asked=False, Question2_Asked=False etc and set the boolean to True
>if asked.
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: Random Questions Without Repeatin, Paul Steven
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]