Login
From:
Fastidious Elegance
(Uncensored)
subscribe
Multi-dimensional weighted random roll (choice, dice, selection)
https://www.sacrideo.us/multi-dimensional-weighted-random-roll-choice-dice-selection/
links
backlinks
Tagged with:
apl
idioms
Roast topics
Find topics
Find it!
Suppose that you want to roll a 6-sided die in APL. That's trivial: ?6 0 ?6 4 ?6 0 ?6 3 Now suppose that you wanted to roll a bunch of times. APL naturally scales, since the "roll" function ? is a primitive scalar function: ?10⍴6 1 5 5 2