3 # $Id: matrix.ruby-2.ruby,v 1.1 2005-03-23 06:11:41 bfulgham Exp $
4 # http://shootout.alioth.debian.org/
6 # Contributed by Christopher Williams
8 n
= (ARGV[0] || 60).to_i
11 n
= (ARGV[0] || 600).to_i
14 def mkmatrix(rows
,cols
)
16 the_rows
= Array
.new(rows
) do |i
|
17 Array
.new(cols
) {|j
| count
+=1 }
22 m1
= mkmatrix(size
,size
)
23 m2
= mkmatrix(size
,size
)
28 puts
"#{mm[0,0]} #{mm[2,3]} #{mm[3,2]} #{mm[4,4]}"