-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlashcardView.rb
55 lines (42 loc) · 967 Bytes
/
FlashcardView.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
50
51
52
53
54
55
class FlashcardView
def open_prompt
display("Welcome to Flashcards! Let's get started learning!\n\n")
end
def display(output)
puts output
end
def show_definition(input)
display(input + "\n\n")
end
def ask_for_answer
print "Guess: "
get_input
end
def get_input
input = STDIN.gets.chomp
end
def prompt_try_again
display("Try again")
end
def prompt_correct
display("That's correct! Nice job!\n")
end
def prompt_incorrect
display("\nIncorrect")
end
def prompt_next_card
display("------Next Card------\n\n")
end
def prompt_completed
display("You completed the deck! Nice work genius!\n\n")
end
def show_attempts(input)
display("Attempts: #{input}\n\n")
end
def prompt_run_repeat
display("You have a few cards that you need to work on. Let's try again.\n\n")
end
def prompt_show_correct_answer(input)
display("The correct answer was: #{input}")
end
end