Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // Better indentation
  2.  
  3. def choose
  4. puts "Do you like programming? Yes or no please."
  5. choice = gets.chomp
  6. case choice.downcase
  7.  
  8. when "yes"
  9. puts "that\'s great!"
  10. when "no"
  11. puts "That\'s too bad!"
  12. when "maybe"
  13. puts "I have no idea what that means."
  14. end
  15. end
  16. choose
  17.  
  18. // Your code so look at the top example and see why its better :)
  19. def choose
  20. puts "Do you like programming? Yes or no please."
  21. choice = gets.chomp
  22. case choice.downcase
  23. when "yes"
  24. puts "that\'s great!"
  25. when "no"
  26. puts "That\'s too bad!"
  27. when "maybe"
  28. puts "I have no idea what that means."
  29. end
  30. end
  31. choose
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement