5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/rwpm.rb', line 5
def self.init
list = ["abandon","ability", "accompany", "accomplish", "account", "authority", "available", "atmosphere", "awareness", "background", "battery", "beginning"]
correct = 0
loop do
word = list[rand(12)]
puts "Type the word: #{word}".colorize(:green)
answer = gets.chomp
if answer == word
correct = correct + 1
end
if answer != word
puts "Fail!".colorize(:red)
end
puts "#{correct} Words Right".colorize(:blue)
end
end
|