lkr #2259(2007/08/17 07:18 GMT) [ Ruby ] Rating0/0=0.00
line1 line2 line3
1 2 3 4 5 6 7 8 9 10 11 12 13 14
def bingo(num) raise ArgumentError.new("fixnum only") unless num.kind_of? Fixnum raise ArgumentError.new("1 ijyou de onegai simasu") unless num >= 1 results = [] ary=(1..num).to_a ary.size.times{ index = (rand * ary.size).to_i results << ary.delete_at(index) } results end
Rating0/0=0.00-0+
[ reply ]
lkr
#2259()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]