RosettaCodeData/Task/Pick-random-element/Emacs-Lisp/pick-random-element.el
2026-04-30 12:34:36 -04:00

5 lines
110 B
EmacsLisp

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