Skip to content

Instantly share code, notes, and snippets.

@rkachowski
Created June 4, 2010 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkachowski/425392 to your computer and use it in GitHub Desktop.
Save rkachowski/425392 to your computer and use it in GitHub Desktop.
@code_words = {
"catapult"=>"chucky go-go",
"starmonkeys"=>"Phil and Pete, those prickly chancellors of the New Reich",
"put the kabosh on"=>"put the cable box on",
"Nigeria"=>"Ny and Jerry's Dry Cleaning (with donuts)",
"firebomb"=>"heat assisted living"
}
load 'codew.rb'
# Get evil idea and swap in code words
print "Enter your new idea: "
idea = gets
@code_words.each do |real, code|
idea.gsub!(real, code)
end
#Save the gibberish to a new file
print "File encoded. Please enter a name for this idea: "
idea_name = gets.strip
File::open("idea-" + idea_name + ".txt", "w") do |f|
f << idea
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment