Created
June 4, 2010 13:13
-
-
Save rkachowski/425392 to your computer and use it in GitHub Desktop.
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
@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" | |
} |
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
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