Advertisement
konalisp

LAYERS.rb

May 28th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def peel(vegetable_with_layers)
  2.     swamp = ["WHAT ARE YOU DOING IN MY SWAMP", "THIS IS MY SWAMP", "THERE IS NO OUR", "STOP SINGING"]
  3.     if vegetable_with_layers[0] == 'core'
  4.         # base case: OGRES HAVE LAYERS
  5.         puts "NOW WHY DID YA HAVE TA GO AND MAKE ME ANGRY"
  6.         vegetable_with_layers[0]
  7.     else
  8.         # ORGERS ARE LIKE ONIONS
  9.         puts swamp[rand(3)]
  10.         peel(vegetable_with_layers[0])
  11.     end
  12. end
  13.  
  14. onion = [[[['core']]]]
  15. peel(onion) #NO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement