Last active
January 11, 2016 02:31
-
-
Save ryanking/966d72cb572cc3a93ec6 to your computer and use it in GitHub Desktop.
powerball number generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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