Advertisement
davispuh

Ruby

Sep 18th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.38 KB | None | 0 0
  1. def example(x,y)
  2.     puts "X:#{x},Y:#{y}"
  3.     if ( x == 0 ) then
  4.       puts "Its true"
  5.     elsif (x == 1)
  6.       puts "Its not true"
  7.       puts "it certainly isn't"
  8.       if (y == 0) then
  9.         puts "i'm the nested if"
  10.       end
  11.     else
  12.       puts "i made it to the default case"
  13.       puts "freedom"
  14.     end
  15. end
  16.  
  17.  
  18. example(0,0)
  19. example(1,0)
  20. example(1,1)
  21. example(2,2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement