09-06-2018, 03:25 AM
(This post was last modified: 09-06-2018, 11:49 PM by AlexZ.
Edit Reason: Some minor changes
)
Hello!
Please, try this:
Macro Use WeightedRandomChoices
Function WeightedRandomChoices
Regards
Please, try this:
Macro Use WeightedRandomChoices
Function WeightedRandomChoices
;/
function'str lpstr'T
str s s1
int i
ARRAY(str) a
foreach s T
,s.trim
,if findrx(s "\d+$" 0 2 s1)<0
,,end F"line: '{s}' needs a number"
,s.findreplace(s1)
,for i 0 val(s1)
,,a[]=s
a.shuffle
ret a[0]
Regards