Skip to content

Instantly share code, notes, and snippets.

@hainesr
Created January 14, 2024 16:31
Show Gist options
  • Save hainesr/1d4e7c07e48fee0e86051c0569d0513c to your computer and use it in GitHub Desktop.
Save hainesr/1d4e7c07e48fee0e86051c0569d0513c to your computer and use it in GitHub Desktop.
Simple Ruby method to generate bingo numbers
def bingo(max)
seen = []
while(seen.size < max)
r = Random.rand(1..max)
next if seen.include?(r)
seen << r
end
seen
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment