Created
April 14, 2013 21:03
-
-
Save xaviershay/5384193 to your computer and use it in GitHub Desktop.
Test for month mappings for http://gmmentalgym.blogspot.com/2011/03/day-of-week-for-any-date-revised.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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