Jump to content

Pick random element: Difference between revisions

Line 53:
 
=={{header|AutoHotkey}}==
; True Arrays
 
{{works with|AutoHotkey_L}}
<lang AHK>list := ["abc", "def", "gh", "ijklmnop", "hello", "world"]
Random, randint, 1, % list.MaxIndex()
MsgBox % List[randint]</lang>
; Pseudo-Arrays
{{works with|AutoHotkey_Basic}}
<lang AutoHotkey>list := "abc,def,gh,ijklmnop,hello,world"
StringSplit list, list, `,
Cookies help us deliver our services. By using our services, you agree to our use of cookies.