Created
August 26, 2010 09:16
-
-
Save rhysforyou/551119 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
# Usage: "ruby heyjude.rb [verses] [output file]" | |
# Inspired by the flowchart at http://loveallthis.tumblr.com/post/166124704 | |
def heyJude(n, fileName) | |
f = File.new(fileName, 'w') | |
n.times do |run| | |
f.syswrite "Hey Jude, " | |
if run % 3 == 1 | |
f.syswrite "don't make it bad\n" | |
f.syswrite "take a sad song and make it better\n\n" | |
elsif run % 3 == 2 | |
f.syswrite "don't be afraid\n" | |
f.syswrite "you were made to go out and get her\n\n" | |
else | |
f.syswrite "don't let me down\n" | |
f.syswrite "you have found her, now go and get her\n\n" | |
end | |
f.syswrite "remember to " + | |
if run % 2 == 1 | |
"let her into your heart\n" | |
else | |
"let her under your skin\n" | |
end | |
f.syswrite "then you " + | |
if run % 2 == 1 | |
"can start" | |
else | |
"begin" | |
end + " to make it better\n" | |
5.times { f.syswrite "better " } | |
f.syswrite "waaaa\n\n" | |
4.times do | |
7.times { f.syswrite "na " } | |
f.syswrite "\n" | |
4.times { f.syswrite "na " } | |
f.syswrite "\n\nHey Jude!\n\n" | |
end | |
end | |
end | |
heyJude(ARGV[0].to_i, ARGV[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment