-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.lxn
More file actions
45 lines (39 loc) · 1.06 KB
/
program.lxn
File metadata and controls
45 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
keep score to 0
keep rounds to whole(ask("How many questions do you want to answer? "))
repeat until rounds = 0
say("Question 1: What is 5 + 3?")
keep answer1 to whole(ask())
when answer1 = 8
say("Correct!")
keep score to score + 1
complete
say("Wrong!")
say("Question 2: What is 10 - 4?")
keep answer2 to whole(ask())
when answer2 = 6
say("Correct!")
keep score to score + 1
complete
say("Wrong!")
say("Question 3: What is the first letter of HPX?")
keep answer3 to letters(ask())
when answer3 = "H"
say("Correct!")
keep score to score + 1
complete
say("Wrong!")
when score = 3
say("Amazing! You got all 3 right!")
or score = 2
say("Great! You got 2 correct!")
or score = 1
say("Not bad! 1 correct!")
complete
say("Oops! No correct answers!")
keep rounds to rounds - 1
when rounds = 0
stop
complete
say("Next round!")
say("Quiz finished! Your final score is:")
say(score)