Last active
December 18, 2015 11:29
-
-
Save ashleygwilliams/5776438 to your computer and use it in GitHub Desktop.
control flow wat -> control flow WUT
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
def step1(x) | |
if x==1 | |
puts "it was all a dream" | |
end | |
return 2 | |
end | |
def step2(x) | |
if x==2 | |
puts "i used to read" | |
end | |
x += 1 | |
y = step3(x) | |
return y | |
end | |
def step3(x) | |
if x==3 | |
puts "Word Up magazine" | |
end | |
return 4 | |
end | |
def step4(x) | |
if x==4 | |
puts %w(SaltnPepa HeavyD).join(' and ') | |
end | |
puts "up in the #{step5(x+=1)}" | |
return step5(x+=2) | |
end | |
def step5(x) | |
if x==5 | |
return "limousine" | |
else | |
puts "hanging pictures on my wall" | |
return 7 | |
end | |
end | |
def step6(x) | |
stuff= [] | |
if x==7 then | |
stuff.push("Saturday Rap Attack", "Mr. Magic", "Marley Marl") | |
elsif x==66 | |
stuff.push() | |
end | |
return stuff.join(', ') | |
end | |
def step7(x) | |
puts "Every #{step6(x)}" | |
return "my tape" | |
end | |
def step8(x) | |
if x=="my tape" | |
puts "i let my tape rock" | |
return "rock" | |
elsif x=="rock" | |
puts "til my tape popped" | |
return "popped" | |
else | |
return %w(smokin' sippin') | |
end | |
end | |
def step9(x) | |
if x.length / 2 == 1 | |
return step10(x.length, x) | |
end | |
end | |
def step10(x) | |
y = %w(weed bamboo sardines) | |
if x.length == 2 | |
return x.insert(1,y[0..1]) | |
else | |
return y[2] | |
end | |
end | |
def step11(x) | |
if x.length % 2 != 0 | |
return x.push("private stock") | |
elsif x.length % 2 == 0 | |
puts "#{x[0]} #{x[1].join(' and ')}, #{x[2]} on #{x[3]}" | |
end | |
end | |
####### JUST FLOW | |
x= 1 | |
step11(step11(step10(step8(step8(step8(step7(step4(step2(step1(1)))))))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment