4 ms·
Oh, dear. It's so hard to turn down a challenge, but I don't think I'd really like to work for ninjas. They sound... oblong? (defun ensure-list (a) (if (listp
by diiq 17y ago
Oh, dear. It's so hard to turn down a challenge, but I don't think I'd really like to work for ninjas. They sound... oblong?
(defun ensure-list (a) (if (listp a) a (loop for i from 0 to a collect i)))
(defparameter l '(0 7 (0 3) (0 3) 7 0 7 (1 4 7) (1 7) (1 7) 1 0 7 1 1 1
1 0 7 1 1 1 1 0 6 (7 1) (7 1) (7 1) 6 0))
(defparameter g (loop for i from 0 to 9 collecting
(loop for i from 1 to (length l)
collecting ())))
(setf g (append (list (mapcar (lambda (sp) 's) (car g))) (cdr g)))
(defun s ()
(setf g (append
(list (loop for i from 1 to (length (car g)) collecting
(if (< .1 (random 1.0)) 's ())))
(loop for i from 1 to (1- (length g)) collecting
(mapcar (lambda (a b x)
(if (and a (or (not (find (- (length globe) i)
(ensure-list x)))
(> .05 (random 1.0))))
's (and b
(not (find (- (length globe) i)
(ensure-list x))))))
(nth (- i 1) g) (nth i g)
l)))))
(defun d (itm)
(cond
((not itm) (format t ". "))
((atom itm) (format t "$$"))
((listp itm) (d (car itm)) (d (cdr itm)) (format t "~&"))))
(defun start ()
(dotimes (x 200) (s)(sleep 1/24)(d g)))
(start)