Skip to content

Instantly share code, notes, and snippets.

@will
Created October 21, 2012 02:31
Show Gist options
  • Save will/3925504 to your computer and use it in GitHub Desktop.
Save will/3925504 to your computer and use it in GitHub Desktop.
learn the nato alphabet
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