-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclivia_generator.rb
49 lines (39 loc) · 1.18 KB
/
clivia_generator.rb
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
# do not forget to require your gem dependencies
# do not forget to require_relative your local dependencies
class CliviaGenerator
# maybe we need to include a couple of modules?
def initialize
# we need to initialize a couple of properties here
end
def start
# welcome message
# prompt the user for an action
# keep going until the user types exit
end
def random_trivia
# load the questions from the api
# questions are loaded, then let's ask them
end
def ask_questions
# ask each question
# if response is correct, put a correct message and increase score
# if response is incorrect, put an incorrect message, and which was the correct answer
# once the questions end, show user's score and promp to save it
end
def save(data)
# write to file the scores data
end
def parse_scores
# get the scores data from file
end
def load_questions
# ask the api for a random set of questions
# then parse the questions
end
def parse_questions
# questions came with an unexpected structure, clean them to make it usable for our purposes
end
def print_scores
# print the scores sorted from top to bottom
end
end