Last active
August 29, 2015 14:17
-
-
Save drusepth/d6d5ec800543ddafb549 to your computer and use it in GitHub Desktop.
rhyming-renamer
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
nicks = %w{ | |
lm aji brodes cbgbt dru ek horm ianweller jruby khwain | |
montgc narada rd reed suroi suscd woodrufb | |
} | |
d = File.readlines('dictionary.txt').to_a | |
puts nicks.map {|nick| | |
o = nick.downcase!.dup | |
while (results = d.select{|line| line.chomp.end_with?(nick)}).length == 0 && nick.length > 0 | |
nick = nick[1, nick.length] | |
end | |
"#{o} is now #{results.first}" | |
}.join("\r") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment