Created
October 21, 2012 02:31
-
-
Save will/3925504 to your computer and use it in GitHub Desktop.
learn the nato alphabet
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
ALPHABET = { | |
A: "alpha", | |
B: "bravo", | |
C: "charlie", | |
D: "delta", | |
E: "echo", | |
F: "foxtrot", | |
G: "golf", | |
H: "hotel", | |
I: "india", | |
J: "juliet", | |
K: "kilo", | |
L: "lima", | |
M: "mike", | |
N: "november", | |
O: "oscar", | |
P: "papa", | |
Q: "quebec", | |
R: "romeo", | |
S: "sierra", | |
T: "tango", | |
U: "uniform", | |
V: "victor", | |
W: "whiskey", | |
X: "x-ray", | |
Y: "yankee", | |
Z: "zulu" } | |
queue = (ALPHABET.to_a * 1).shuffle | |
while pair = queue.pop | |
letter, word = pair | |
print "#{letter}: " | |
unless gets.chomp == word | |
puts " ! #{word}" | |
3.times { queue << pair } | |
queue.shuffle! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment