Skip to content

Instantly share code, notes, and snippets.

@brandonhilkert
Last active June 12, 2018 14:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save brandonhilkert/7848392 to your computer and use it in GitHub Desktop.
Save brandonhilkert/7848392 to your computer and use it in GitHub Desktop.
class MegaLotto
NUMBERS = 5
def draw
NUMBERS.times.inject([]) do |arr, i|
arr << single_draw
end
end
private
def single_draw
rand(0...60)
end
end
MegaLotto.new.draw # => [23, 22, 3, 7, 16]
@sonianand11
Copy link

sounds good to me. looking froward for next session of course 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment