Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (12 sloc) 463 Bytes
(in-package :academy)
(defun random-element (sequence)
(elt sequence (random (length sequence))))
(defun random-booleans (num &optional (probability 2))
(loop for i from 1 to num
collect (zerop (random probability))))
(defmacro random-do (&rest statements)
(let ((length (length statements)))
`(case (random ,length)
,@(loop for x from 0 to length
for statement in statements
collect `(,x ,statement)))))