Skip to content

Instantly share code, notes, and snippets.

@ryanking
Last active January 11, 2016 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanking/966d72cb572cc3a93ec6 to your computer and use it in GitHub Desktop.
Save ryanking/966d72cb572cc3a93ec6 to your computer and use it in GitHub Desktop.
powerball number generator
#!/usr/bin/env ruby
require 'colorize'
white_ball_drum = (1..69).to_a
red_ball_drum = (1..26).to_a
white_balls = []
red_ball = nil
5.times do
white_balls << white_ball_drum.delete_at(Random.rand(white_ball_drum.length))
end
red_ball = red_ball_drum.delete_at(Random.rand(red_ball_drum.length))
print white_balls.join(' ').white, ' ', red_ball.to_s.red, "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment