いろんな言語で宿題スレ
■ このスレッドは過去ログ倉庫に格納されています
0835デフォルトの名無しさん
2009/10/24(土) 04:14:48(defun get-ramdom-list (num)
(let (lst)
(dotimes (i num)
(setf lst (cons i lst)))
(dotimes (i (random num))
(let (tmp (i1 (random num)) (i2 (random num)))
(setf tmp (car (nthcdr i1 lst)))
(setf (car (nthcdr i1 lst)) (car (nthcdr i2 lst)))
(setf (car (nthcdr i2 lst)) tmp)))
lst))
■ このスレッドは過去ログ倉庫に格納されています