All pastes #452651 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-22 12:45 UTC
rendered paste body
(defun rotate-array (arr)
  (let ((width (car (array-dimensions arr))) (height (cadr (array-dimensions arr))))
    (if (equal width height)
	(progn
	  (setf arr2 (make-array `(,width ,height) :initial-element nil))
	  (dotimes (i width)
	    (dotimes (j width)
	      (setf (aref arr2 i j) (aref arr (- (- width 1) j) i)))))
      nil))
  arr2)