Skip to content

Instantly share code, notes, and snippets.

@rwoeber
Created February 3, 2010 19:54
Show Gist options
  • Save rwoeber/293950 to your computer and use it in GitHub Desktop.
Save rwoeber/293950 to your computer and use it in GitHub Desktop.
# Solution to PragProg Magazine 8 Quiz
# (added Comment into the first line)
quiz8 = %q{
-- Vqnbg nm qhg
qstgq xhmtunsm Vqneg(uvlu)
qstgq wvojsmov = ""
qstgq hovw = ouwnmc.hjjvw(uvlu)
qstgq hovwSwnc = hovw
-- wgmrsfqk ovqvtuvr wvjqnvo nx ms avkiswro
qstgq wgmrWvjqnvo = {
"IZGU RSVO UZGU OHCCVOU US KSH?",
"N OVV...",
"N'F MSU OHWV N HMRVWOUGMR KSH XHQQK.",
"TGM KSH VQGYSWGUV SM UZGU?",
"UZGU NO PHNUV NMUVWVOUNMC!",
"UZGU'O OS... JQVGOV TSMUNMHV...",
"N HMRVWOUGMR...",
"IVQQ, IVQQ... RS CS SM",
"IZK GWV KSH OGKNMC UZGU?",
"JQVGOV VLJQGNM UZV YGTACWSHMR US UZGU WVFGWA...",
"TSHQR KSH OGK UZGU GCGNM, NM G RNXXVWVMU IGK?",
}
...
-- tsmdhcguv
qstgq tsmdhcguv = {
[" N "] = "KSH",
[" GWV "] = "GF",
[" IVWV "] = "IGO",
[" KSH "] = "FV",
[" KSHW "] = "FK",
[" N'BV "] = "KSH'BV",
[" N'F "] = "KSH'WV",
[" FV "] = "KSH",
[" GF N "] = "KSH GWV",
[" GF "] = "GWV",
}
-- wgmrsf wvjqnvo, ms avkiswr
qstgq xhmtunsm wvjqkWgmrsfqk()
wvojsmov = wgmrWvjqnvo[fguz.wgmrsf(ugyqv.cvum(wgmrWvjqnvo))].."\m"
vmr
}
puts quiz8.tr('qstgxhmunovfwrkzcjilyabQSTGXHMUNOVFWRKZCJILYAB', 'locafuntisemrdyhgpwxbkzLOCAFUNTISEMRDYHGPWXBKZ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment