Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LISP

random choice from list of strings in emacs lisp

;; Emacs Lisp
(defun random-choice (items)
  (nth (random (length items)) items))
 
(random-choice '("a" "b" "c"))
;; => "a"
Source by www.rosettacode.org #
 
PREVIOUS NEXT
Tagged: #random #choice #list #strings #emacs #lisp
ADD COMMENT
Topic
Name
1+7 =