Learn how to a build a cloud-first strategyRegister Now


actionscript math ramndom?

Posted on 2004-11-07
Medium Priority
Last Modified: 2010-05-18
Sorry but last time forgot 2 put points for my dear helping Expert!
Here is the question and my code.
The question is that Im tryng to build an educational quiz with a set amount of questions to be outputted! How do I make sure that the same question is not repeated and that once il questions are put forward the program exits?
Here is my initial code. Hope u can help me would be very educational 4 me
Many thanks! (hope I havent been mean with the points! I think it may be easy 4 an expert!)

words=["Which is the capitol of Italy?","Which is the capitol of Spain?","Which is the capitol of France?","Which is the capitol of Holland?"];
Question by:andreafp
1 Comment
LVL 85

Accepted Solution

ozo earned 450 total points
ID: 12519049
in Perl:
           # fisher_yates_shuffle( \@array ) :
           # generate a random permutation of @array in place
           sub fisher_yates_shuffle {
               my $array = shift;
               my $i;
               for ($i = @$array; --$i; ) {
                   my $j = int rand ($i+1);
                   @$array[$i,$j] = @$array[$j,$i];

           fisher_yates_shuffle( \@array );    # permutes @array in place

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn different types of Android Layout and some basics of an Android App.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Starting up a Project

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question