Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Random_lottery
- def start_game
- while true
- puts "Enter a number between 1 and 5"
- intNumb = gets.to_i
- if (0..5).include?(intNumb) then random_lot
- else puts ("input not accepted")
- end
- end
- def random_lot
- random_numb = Random.rand(5)
- puts "Your random generated number is ",random_numb
- end
- end
- game1 = Random_lottery.new
- game1.start_game
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement