Created
June 26, 2013 00:32
-
-
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
This file contains hidden or 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
#!/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