Anonymous user
Pick random element: Difference between revisions
no edit summary
(→{{header|AutoHotkey}}: AutoHotkey example added) |
No edit summary |
||
Line 2:
Demonstrate how to pick a random element from a list.
=={{header|Aime}}==
<lang aime>list l;
l_append(l, 'a');
l_append(l, 'b');
l_append(l, 'c');
l_append(l, 'd');
l_append(l, 'e');
l_append(l, 'f');
o_byte(l_query(l, drand(5)));
o_byte('\n');</lang>
=={{header|AutoHotkey}}==
<lang AutoHotkey>list := "abc,def,gh,ijklmnop,hello,world"
StringSplit list, list, `,
|