gen_matrix.rb 214 B

12345678910111213141516171819202122
  1. #!/usr/bin/env ruby
  2. matrix = []
  3. 100.times {
  4. column = []
  5. 100.times {
  6. column.push(rand(1000))
  7. }
  8. matrix.push(column)
  9. }
  10. puts "[ "
  11. print matrix.collect {|r|
  12. "[ " + r.join(", ") + "],\n"
  13. }
  14. puts "]"