Skip to content

Instantly share code, notes, and snippets.

@rickhull
Created November 10, 2017 05:13
Show Gist options
  • Save rickhull/3faea1f55cb7143be1238526edfb38ca to your computer and use it in GitHub Desktop.
Save rickhull/3faea1f55cb7143be1238526edfb38ca to your computer and use it in GitHub Desktop.
RANDMAX = 1_000
NUMBERWANG = 1_000
NUMS = (0..(RANDMAX - 1)).to_a.shuffle
def number(num)
if num % NUMBERWANG == 0
NUMS.shift
NUMS.push rand RANDMAX
end
NUMS[num % RANDMAX]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment