-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz
More file actions
executable file
·49 lines (39 loc) · 1 KB
/
quiz
File metadata and controls
executable file
·49 lines (39 loc) · 1 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
46
47
48
49
#!/usr/bin/env python3
import random
import colors as c
score = 0
print(c.clear)
print(c.blue + 'Welcome to the redstone quiz.' + c.reset)
def q1():
print(c.reset + c.blue + 'What level is redstone most common on?')
answer = input('> ')
if answer == "16":
print(c.reset + c.green + 'Correct.')
return 1
else:
lose()
return 0
def q2():
print(c.reset + c.blue + 'How many blocks does a redstone pulse travel?')
answer = input('> ')
if answer == "15":
print(c.reset + c.green + 'Correct.')
return 1
else:
lose()
return 0
def q3():
print(c.reset + c.blue + 'How many blocks can one piston push?')
answer = input('> ')
if answer == "12":
print(c.reset + c.green + 'Correct.')
return 1
else:
return 0
questions = [q1,q2,q3]
while questions:
question = random.choice(questions)
points = question()
score += points
if points:
questions.remove(question)