RosettaCodeData/Task/Pick-random-element/Emacs-Lisp/pick-random-element.l
2023-07-01 13:44:08 -04:00

5 lines
110 B
Common Lisp

(defun random-choice (items)
(nth (random (length items)) items))
(random-choice '("a" "b" "c"))
;; => "a"