Skip to content

Instantly share code, notes, and snippets.

@ywjno
Created July 18, 2012 09:19
Show Gist options
  • Save ywjno/3135208 to your computer and use it in GitHub Desktop.
Save ywjno/3135208 to your computer and use it in GitHub Desktop.
create shuang_se_qiu number
#encoding: utf-8
class ShuangSeQiu
def initialize
@times = ARGV && ARGV[0] ? ARGV[0].to_i : 5
end
def create
@times.times do |time|
reds = []
base_rads = Array.new(36) {|i| i + 1}
6.times do |r|
length = base_rads.length
reds << base_rads.delete_at(Random.rand(0..length - 1))
end
puts "red number are #{reds.sort.join(', ')}"
puts "blue number is #{Random.rand(1..16)}"
puts '='*80
end
end
end
ShuangSeQiu.new.create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment