0 votes
by (120 points)
I'm working on a multiple choice quiz and I've already made all the questions and the category point system for the questions. (if you click option A, it puts a point in the option A category)

Here's the code I have that adds points:

(link: "Option A)[
    (set: $Option A to it + 1)
    (set: $answers to it + (array: "A"))
    (goto: "Question 3")]

 

How do I show which category has the most points?

1 Answer

0 votes
by (590 points)
I'm slightly confused by the setup of the code, wouldn't it be easier to not mess with arrays and just use variables? For example, $catA, $catB, etc, and then just add a point to whichever category was chosen? if you did this instead, you could just type $catA and then when you play the game it will show whatever score the category has. If there's a reason for arrays being used instead, I'd love to know, and maybe it would help come up with an answer, because honestly, I'm not sure how to mess with an array except to add and remove things from it, and it's usually a list of items, not a score. If you're determined to use an array, though, you could always use google to find out how to print the contents. It's probably the print command. But if you could tell us your goal with the code you're using, it would help with finding a more accurate and satisfactory answer.
...