Advertisement
Guest User

Untitled

a guest
Feb 15th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. class Random_lottery
  2.  
  3. def start_game
  4. while true
  5. puts "Enter a number between 1 and 5"
  6. intNumb = gets.to_i
  7. if (0..5).include?(intNumb) then random_lot
  8. else puts ("input not accepted")
  9. end
  10. end
  11.  
  12. def random_lot
  13. random_numb = Random.rand(5)
  14. puts "Your random generated number is ",random_numb
  15. end
  16. end
  17.  
  18. game1 = Random_lottery.new
  19. game1.start_game
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement