Created
September 14, 2009 06:39
-
-
Save horus/186536 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; get some random elements from a list | |
;; i know it's dumb | |
(defparameter *data* '(192 123 34 23 67 3 45 342)) | |
(defun get-and-remove () | |
(let ((one (nth (random (length *data*)) *data*))) | |
(setf *data* (remove one *data*)) | |
one)) | |
(defun getrnd (n) | |
(if (<= n (length *data*)) | |
(loop for x from 1 to n collect (get-and-remove)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment