lkr #2261(2007/08/17 07:24 GMT) [ Ruby ] Rating0/0=0.00
普通にやってみた
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
#2261()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]