Forum Discussion
OwenHolt
9 years agoSuper Hero
Trivia Game - Using Variables and JavaScript to remove answered questions from the deck.
Concept Create a trivia game that would:
Randomly select a category from a list of 5, but limit the selection to only categories containing unanswered questions.
Display a random question in...
EvaHorne
7 years agoCommunity Member
Hi folks! I am currently using a version of this code to choose more than one number from the array by repeating parts of the code the number of times that I want it to run. For example, I have 100 flowers and I want to randomly choose 5 of them, so I copy/paste the last three lines of the code five times. It works that way, but will become cludgy when I get to the slide where I need for it to choose 50 of the flowers. I know that there are loops in javascript, but have so far not been able to figure out how to get a loop to work. Do any of you know how to loop this code? Thanks!