Pub Quiz Project

[spoiler][code]“Quiz Night” by Michael Callaghan

Include questions by Michael Callaghan.
Use scoring

The Round1 is a room. "Welcome to Trivia, I’m your host, the disembodied voice coming from your device. We have only one rule; please don’t cheat. Questions will be simple this round being worth five points a piece, but will increase in both difficulty and value as the game goes on. "

After looking for the first time:
follow the pub1 rule.

Table of quiz questions
Qn Correct
“According to the Old Testament, who spent 3 days and nights in the belly of a whale?” “Jonah”
“The Tom Green Show and 16 and Pregnant were originally aired on what network?” “MTV”
“The Soul and The Optima are both models by what auto make?” “Kia”
“Kim Jong Il, Joseph Stalin, or Mao Tsedong, which dictator ruled the longest?” “Mao Tsedong”

The expected answer is a text that varies.

Every turn when the location is The Round1 (this is the pub1 rule):
choose a random row in the table of quiz questions;
now current question is the Qn entry;
now expected answer is the correct entry;
blank out the whole row;
ask a closed question, in text mode.

A text question rule (this is the pub answer rule):
if the location of the player is Round1:
if the current answer is the expected answer:
if the table of quiz questions is not empty:
increase score by 5;
say “Well done. Next question.”;
exit;
otherwise:
say “That was Round One, now onto Round Two!”;
increase score by 5;
move the player to The Round2;
exit;
follow the pub2 rule;
otherwise:
if the table of quiz questions is not empty:
say “Incorrect. Next question.”;
exit;
otherwise:
say “That was Round One, now onto Round Two!”;
move the player to The Round2;
exit;
follow the pub2 rule.

The Round2 is a room. “Now onto Round Two where the questions get slightly harder but are worth ten points a piece.”

Table of quiz questions2
Qn2 Correct2
"Get a Mac was an ad slogan for what company from 2006 to 2009? " “Apple”
“What is the capital of Egypt?” “Cairo”
“In the contract version of what card game are players identified by points on the compass?” “Bridge”
“What movie has the Highland Games, a Witch, and Craig Ferguson as Lord Macintosh?” “Brave”

The expected answer is a text that varies.

Every turn when the location is The Round2 (this is the pub2 rule):
choose a random row in the table of quiz questions2;
now current question is the Qn2 entry;
now expected answer is the correct2 entry;
blank out the whole row;
ask a closed question, in text mode.

A text question rule (this is the pub2 answer rule):
if the location of the player is Round2:
if the current answer is the expected answer:
if the table of quiz questions2 is not empty:
increase score by 10;
say “Well done. Next question.”;
exit;
otherwise:
say “That was Round Two, now onto Round Three where things get a bit more difficult!”;
increase score by 10;
move the player to The Round3;
exit;
follow the pub3 rule;
otherwise:
if the table of quiz questions is not empty:
say “Incorrect. Next question.”;
exit;
otherwise:
say “That was Round Two, now onto Round Three!”;
move the player to The Round3;
exit;
follow the pub3 rule.

The Round3 is a room. “Round Three is here! The questions are harder but now worth fifteen points a piece.”

Table of quiz questions3
Qn3 Correct3
“In 1908, what Ford Model was first produced, eventually being named the Car of the Century?” “Model T”
“The Original Ritz Hotel is located in what European City?” “Paris”
“Ebony and Ivory was a duet performed by Stevie Wonder and what former Beatle?” “Paul McCartney”
“In what year did Spongebob Squarepants premier on television, Wide Open Spaces by the Dixie Chicks won a Grammy, and the Sixth Sense premiered in theaters?” “1999”

The expected answer is a text that varies.

Every turn when the location is The Round3 (this is the pub3 rule):
choose a random row in the table of quiz questions3;
now current question is the Qn3 entry;
now expected answer is the correct3 entry;
blank out the whole row;
ask a closed question, in text mode.

A text question rule (this is the pub3 answer rule):
if the location of the player is Round3:
if the current answer is the expected answer:
if the table of quiz questions3 is not empty:
increase score by 15;
say “Well done. Next question.”;
exit;
otherwise:
say “That was Round Three, now onto Round Four!”;
increase score by 15;
move the player to The Round4;
exit;
follow the pub4 rule;
otherwise:
if the table of quiz questions is not empty:
say “Incorrect. Next question.”;
exit;
otherwise:
say “That was Round Three, now onto Round Four!”;
move the player to The Round4;
exit;
follow the pub4 rule.

The Round4 is a room. “This is it, the final round. Europe’s The Final Countdown is now playing on loop in your head and the questions are worth a whopping twenty points a piece.”

Table of quiz questions4
Qn4 Correct4
“Spteznaz is an umbrella term for special forces from what country?” “Russia”
“CVX is the stock ticker symbol for what energy giant?” “Chevron”
"What actor or actress was in X-Men the Last Stand, Inception, and Juno? " “Ellen Page”
“Double Think and Cold War are both terms created by what English Author?” “George Orwell”

The expected answer is a text that varies.

Every turn when the location is The Round4 (this is the pub4 rule):
choose a random row in the table of quiz questions4;
now current question is the Qn4 entry;
now expected answer is the correct4 entry;
blank out the whole row;
ask a closed question, in text mode.

A text question rule (this is the pub4 answer rule):
if the location of the player is Round4:
if the current answer is the expected answer:
if the table of quiz questions4 is not empty:
increase score by 20;
say “Well done. Next question.”;
exit;
otherwise:
say “Well done. That was the end of Round Four.”;
increase score by 20;
move the player to The End;
otherwise:
if the table of quiz questions4 is not empty:
say “Incorrect. Next question.”;
exit;
otherwise:
say “Incorrect. That was the end of Round Four.”;
move the player to The Final;
exit.

The Final is a room. “This is it, the final question. Wager anything between all and none of your points on this final question. The Category for the final question is Sports.”

Data is a kind of value. The data is wager.

Bonus is a scene. Bonus begins when the location is The Final.
Bonus ends when stage is complete.
Stage is data that varies.

When Bonus begins:
now stage is betting.

Every turn during Bonus:
if stage is betting:
now current question is “How much of your score do you want to wager on the Bonus Question?”
ask a closed question, in number mode;

The player’s wager is a number that varies.

A number question rule (this is the gather wager rule):
if Bonus is happening and stage is betting:
if the number understood is greater than score:
say “You cannot wager more than your score, silly!”;
now the player’s wager is the number understood;
say “Alright, you have wagered [the player’s wager] points. Let’s do this!”;
move the player to Round5;
exit;
follow the pub5 rule.

The Round5 is a room. “Final bonus question for the game. Your wager will be added to or subtracted from your score. List the following NFL Franchises from oldest to newest by assigning the number 1 for oldest and 5 for the newest.”

Table of quiz questions5
Qn5 Correct5
“The Atlanta Falcons” “5”
“The Chicago Bears” “1”
“The Dallas Cowboys” “3”
“The New Orleans Saints” “4”
“The Philadelphia Eagles” “2”

The expected answer is a text that varies.

Every turn when the location is The Round5 (this is the pub5 rule):
choose a random row in the table of quiz questions5;
now current question is the Qn5 entry;
now expected answer is the correct5 entry;
blank out the whole row;
ask a closed question, in text mode.

A text question rule (this is the pub5answer rule):
if the location of the player is Round5:
if the current answer is the expected answer:
if the table of quiz questions5 is not empty:
say “Uh huh, keep going…”;
exit;
otherwise:
say “You did it, you got the bonus correct!”;
increase score by [the player’s wager];
move the player to The End;
otherwise:
say “I’m sorry, that’s incorrect. Sadly, there is no partial credit for the bonus question”;
decrease score by [the player’s wager];
move the player to The End;
exit.

The End is a room. “That’s it for this game of trivia. I’m your device running Grue and I hope you enjoyed the game. Join me again for another game anytime you’d like. Your Final Score comes to: [score]/200”.[/code][/spoiler]

So that’s what I have now. It works when it’s just Round 4 and then the End room. The trouble comes with The Final and Round5. I tried moving it to the left via highlighting and formatting but no joy. Getting the following for errors now:

This is starting to get infuriating. Any tips? Ideas?

I apologize, my explanation of how to fix that may not have been good. Currently, the problem with those rules is that the second line (the line after the header) is flush left, and it needs to be indented one tab. And then everything under that needs to be indented one tab. The general idea is that, whenever you have something ending in a colon, the line under it needs to be one more tab stop in.

So you’d have:

Every turn during Bonus: if stage is betting: now current question is "How much of your score do you want to wager on the Bonus Question?" ask a closed question, in number mode;

Hope this is helpful!