Skip to content

Instantly share code, notes, and snippets.

@FiXato
Created June 26, 2013 00:32
Show Gist options
  • Save FiXato/5863756 to your computer and use it in GitHub Desktop.
Save FiXato/5863756 to your computer and use it in GitHub Desktop.
Whenever I am sad, I stop being sad, and be awesome instead: https://www.youtube.com/watch?v=veINDSTr3r4
#!/usr/bin/env ruby
# encoding: utf-8
def sad?
@status == 'sad'
end
def stop_being_sad
puts "I stop being sad."
@status = ''
end
def be_awesome
puts "Be awesome instead!"
@status = 'awesome'
end
@status = 'sad'
while (sad?)
puts "Whenever I am #{@status}"
stop_being_sad
be_awesome
end
puts "So now I am #{@status}! True story."
# Output:
#---------------------------------
# Whenever I am sad
# I stop being sad.
# Be awesome instead!
# So now I am awesome! True story.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment