Title / Description
Code def something a = [ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ], [ 9, 10,11,12 ], [ 13,14,15,16 ] ] puts a.inspect (0..3).each do |i| (0..3).each do |j| aux = a[i][j] a[i][j] = a[j][i] a[j][i] = aux end end puts a.inspect end something
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code