Last active
May 15, 2018 01:48
-
-
Save stevenocchipinti/5261dc00f28b42e059d4d23cf3f74208 to your computer and use it in GitHub Desktop.
PPAP
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
# https://www.youtube.com/watch?v=Ct6BUPvE2sM | |
def ouhh(left, right) | |
if left == "pen" && right == "apple" | |
"apple-pen" | |
elsif left == "pen" && right == "pineapple" | |
return "pineapple-pen" | |
elsif left == "apple-pen" && right == "pineapple-pen" | |
return "pen-pineapple-apple-pen" | |
end | |
end | |
def i_have_a(thing) | |
if thing == "apple" || thing == "pineapple" || thing == "pen" | |
puts "I have a #{thing}" | |
elsif thing.include? "-" | |
puts "ouhh! #{thing}" | |
else | |
puts thing | |
end | |
end | |
def stretch(thing) | |
puts thing.sub(/[aeiou]/) { |vowel| vowel * 10 } | |
end | |
i_have_a "pen" | |
i_have_a "apple" | |
apple_pen = ouhh "pen", "apple" | |
i_have_a apple_pen | |
i_have_a "pen" | |
i_have_a "pineapple" | |
pineapple_pen = ouhh "pen", "pineapple" | |
i_have_a pineapple_pen | |
stretch apple_pen | |
stretch pineapple_pen | |
i_have_a ouhh apple_pen, pineapple_pen |
Author
stevenocchipinti
commented
May 15, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment