Sha256: 4c409d12ced4c3ff39c14ef7b8469d08d889b2f82f742ccf26fbaf9824a163bc
Contents?: true
Size: 372 Bytes
Versions: 1
Compression:
Stored size: 372 Bytes
Contents
module AwesomeGameRandomizer class Lotto def self.pick(count, nums) lotto_nums = [] i = 0 if count <= nums while i < count pick = rand(1..nums) unless lotto_nums.include?(pick) lotto_nums << pick i += 1 end end end puts "Error: not enough numbers" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
awesome_game_randomizer-0.1.1 | lib/awesome_game_randomizer/lotto.rb |