;; AI Final Project ;; Module: Utils ;; CSC 466 - Graci ;; Jacob Peck - 20110427 ; picks a random element of a list (defmethod pick ((l list)) (nth (random (length l)) l) ) ; returns the first n elements of a list (defmethod firstn ((l list) (nr integer)) (subseq l 0 nr) ) ; outputs a list of symbols into a space-delimited string (for file saving) (defmethod list-to-string ((l list) &aux str) (setf str "") (dolist (element l NIL) (setf str (concatenate 'string str (write-to-string element) " ")) ) (string-trim " " str) )