Question : random choice from list of strings in emacs lisp
Answered by : nopanun-laochunhanun
;; Emacs Lisp
(defun random-choice (items) (nth (random (length items)) items))
(random-choice '("a" "b" "c"))
;; => "a"
Source : https://www.rosettacode.org/wiki/Pick_random_element#Emacs_Lisp | Last Update : Fri, 06 May 22