Skip to content

Instantly share code, notes, and snippets.

@xaviershay
Created April 14, 2013 21:03
Show Gist options
  • Save xaviershay/5384193 to your computer and use it in GitHub Desktop.
Save xaviershay/5384193 to your computer and use it in GitHub Desktop.
months = {
'Jan' => 6,
'Feb' => 2,
'Mar' => 2,
'Apr' => 5,
'May' => 0,
'Jun' => 3,
'Jul' => 5,
'Aug' => 1,
'Sep' => 4,
'Oct' => 6,
'Nov' => 2,
'Dec' => 4
}
wrong = []
start_time = Time.now
print "\e[2J\e[f"
10.times do
x = months.to_a.sample
print x[0]
print ' '
answer = gets
if answer.chomp.to_i != x[1]
wrong << x[0]
end
print "\e[2J\e[f"
end
puts Time.now - start_time
puts wrong.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment