From: Luke Cowell Date: 2009-06-16T13:14:16+09:00 Subject: Re: Matrix Rotator (#209) My solution: def self.rotate(rect) rotated = [] rect.each_with_index do |row, irow| row.reverse.each_with_index do |col, icol| rotated[icol] ||= [] rotated[icol][irow] = col end end rotated end It works by reversing the elements in the row and then swapping elements in the x & y axis. Luke -- Posted via http://www.ruby-forum.com/.