(define (shuffle ls) (let ((len (length ls))) (if (< len 2) ls (let loop ((x (random len)) (a '()) (b ls)) (if (zero? x) (append (shuffle (reverse b)) (shuffle a)) (loop (- x 1) (cons (car b) a) (cdr b)))))))