Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (12 sloc) 0.463 kb
(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)))))
Jump to Line
Something went wrong with that request. Please try again.