; your code goes here
(defun newList (&optional(n 100))
(loop for i from (- n 1) downto 0 collect i))
(defun board (l &optional(n 10))
(cond
((null l) nil)
(t (cons (subseq l 0 n) (board (subseq l n) n)))))
(defun show-board (board)
(format T "~%")
(mapcar (lambda (x) (format T " ~A ~%" x)) board)
(format nil "")
)
(defun remove-duplicate (pred l)
(cond ((null l) NIL)
((funcall pred (car l)) (remove-duplicate pred (cdr l)))
(T (cons (car l) (remove-duplicate pred (cdr l))))))
(defun shuffle-list (l)
;;iterate 99
(dotimes (i (- (length l) 1))
;;store random number to n
(let ((n (nth (random (length l)) l)))
;;print value of n
(format t "~% ~A" n)
(cond
((null l) nil)
;;I have this but it´s not show the new list
(t (remove-duplicate #'(lambda (x) (= x n)) l))))))
;;print board
(print "--- INICIAL BOARD ---")
(show-board (board (newList)))
;; should print board with random number
(print "--- should create final BOARD with random number")
(show-board (board (shuffle-list (newList))))