Random

choice


(let choice (fun (_L) (...))) Select a random element from a list

Note: If the list is empty, returns nil

Author: @SuperFola

Parameter

  • _L: list of elements

Example

(let data [1 2 3 4 5])
(print (random:choice data))

shuffle


(let shuffle (fun (_L) (...))) Shuffle a given list

Note: The original list is not modified

Author: @SuperFola

Parameter

  • _L: list to shuffle

Example

(let data [1 2 3 4 5])
(let randomized (random:shuffle data))