-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.rb
53 lines (40 loc) · 925 Bytes
/
view.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
require 'colorize'
class View
def welcome
puts "\nWelcome to Trivial Pursuit. Just guess the answer to the question.\nReady? Let's play!"
end
def theme
puts "\nChoose a theme: (1.History 2.Science 3.Pop culture)"
end
def question(qa)
puts "\nQuestion\n#{qa[0]}"
print "Answer: "
end
def correcto
puts "¡Correct!".colorize(:green)
end
def incorrecto
puts "¡Incorrect!".colorize(:red)
end
def final(correct, incorrect)
puts "\nYou had" + " #{correct} Correct answers ".colorize(:green) + "and" + " #{incorrect} Incorrect answers.\n".colorize(:red)
puts "Thanks for playing!"
end
def error
puts "Only numbers displayed"
end
def pantalla_dinamica
clear_screen!()
move_to_home!()
reputs()
end
def clear_screen!
print "\e[2J"
end
def move_to_home!
print "\e[H"
end
def reputs(str = '')
puts "\e[0K" + str
end
end