Logo

Programming-Idioms

History of Idiom 11 > diff from v74 to v76

Edit summary for version 76 by foobar:
New Lisp implementation by user [foobar]

Version 74

2019-05-05, 16:11:15

Version 76

2019-09-26, 16:06:41

Idiom #11 Pick a random element from a list

List x must be non-empty.

Illustration

Idiom #11 Pick a random element from a list

List x must be non-empty.

Illustration
Extra Keywords
choose
Extra Keywords
choose
Code
(nth (random (length x)) x)
Code
(nth (random (length x)) x)