quizworld's Code

Created by: SHR

world

Events

When the world starts
Do:
world.my first method


Methods

  world.my first method ( )
    No variables
       penguin say time for a quiz
  penguin.numberCorrect set value to 0
  world.quiz
  penguin say ( you got joined with ( ( ( int penguin.numberCorrect ) as a string ) joined with correct ) )
  penguin say That's all folks


  world.quiz ( )
    answerNumber = 1 , answerBoolean = true , answerString = default string , numberOfTries = 1
       // Question #1
  penguin say How many animals are there in this world? duration = 2 seconds
  answerNumber set value to 1
  While ( answerNumber != 5 )
       answerNumber set value to ( ask user for a number question = Enter the number of animals in this world )
  If ( answerNumber == 5 )
       penguin say Correct
  increment penguin.numberCorrect by 1
  penguin.wing_flap times = 2
  Else
    penguin say Sorry, that is not correct. Try again
  // Question #2
  penguin say Are there more chickens than penquins? duration = 2 seconds
  answerBoolean set value to ( ask user for yes or no question = Click yes or no )
  If ( answerBoolean == true )
       penguin say Correct
  increment penguin.numberCorrect by 1
  penguin turn left 1 revolution
  Else
    penguin say Sorry, that is not correct
  // Question #3
  penguin say What building are we in?
  numberOfTries set value to 0
  While ( numberOfTries < 3 )
       answerString set value to ( ask user for a string question = What building are we in (type acronymn): )
  If ( either ( answerString == lsrc ) or ( answerString == LSRC ) , or both )
       penguin say Correct
  increment penguin.numberCorrect by 1
  penguin move up 0.5 meters duration = 0.25 seconds
  penguin roll left 1 revolution
  penguin move down 0.5 meters duration = 0.25 seconds
  // We want to stop, force this by setting numberOfTries to a number 3 or bigger
  numberOfTries set value to 5
  Else
    penguin say Sorry that is not correct
  increment numberOfTries by 1