Pick random element: Difference between revisions
Content deleted Content added
Simple9371 (talk | contribs) |
|||
Line 841:
Selecting term 3 in the list, which was George
</pre>
=={{header|VBScript}}==
<lang vb>
Function pick_random(arr)
Set objRandom = CreateObject("System.Random")
pick_random = arr(objRandom.Next_2(0,UBound(arr)+1))
End Function
WScript.Echo pick_random(Array("a","b","c","d","e","f"))
</lang>
{{Out}}
<pre>d</pre>
=={{header|XPL0}}==
|