#!/usr/bin/env ruby matrix = [] 100.times { column = [] 100.times { column.push(rand(1000)) } matrix.push(column) } puts "[ " print matrix.collect {|r| "[ " + r.join(", ") + "],\n" } puts "]"