(defun shuffle (seq) (let ((arr (map 'vector 'identity seq))) (loop for i from (1- (length arr)) downto 1 for j = (random i) do (rotatef (aref arr i) (aref arr j)) finally (return (coerce arr (type-of seq))))))