Pick random element: Difference between revisions
Content deleted Content added
Shorter D entry |
|||
Line 172: | Line 172: | ||
void main() { |
void main() { |
||
const items = ["foo", "bar", "baz"]; |
|||
items[uniform(0, $)].writeln; |
|||
writeln(r); |
|||
}</lang> |
}</lang> |
||
=={{header|Déjà Vu}}== |
=={{header|Déjà Vu}}== |
||
<lang dejavu>print choose [ "one" "two" "chicken" ]</lang> |
<lang dejavu>print choose [ "one" "two" "chicken" ]</lang> |