标签: ruby-on-rails ruby
如何在表格(视图)中显示数组数组?
matrix = Array.new(rows){Array.new(cols){0}}
0 0 0 0 0 0 0 0 0 0 0 0
答案 0 :(得分:1)
matrix = Array.new(3){Array.new(4){0}} puts matrix.map {|x| x.join(' ')} 0 0 0 0 0 0 0 0 0 0 0 0