Pick random element: Difference between revisions
Content deleted Content added
→{{header|AutoHotkey}}: AutoHotkey example added |
|||
Line 2: | Line 2: | ||
Demonstrate how to pick a random element from a list. |
Demonstrate how to pick a random element from a list. |
||
=={{header|AutoHotkey}}== |
|||
<lang AutoHotkey>list := "abc,def,gh,ijklmnop,hello,world" |
|||
StringSplit list, list, `, |
|||
Random, randint, 1, %list0% |
|||
MsgBox % List%randint%</lang> |
|||
=={{header|C}}== |
=={{header|C}}== |
||
<lang C>#include <stdio.h> |
<lang C>#include <stdio.h> |