Hi there,
I am trying to build an app that randomly selects an item from a list (fruits) based on a given probability. So, what it should be doing is the following:
Press Button
Returns “Hi you won a Apple”
I read this previous post which suggests to use the math.js plugin.
I think I found the math.js formula I need which should be this
math.pickRandom(array, weights)
However, I have no idea where to create a list of fruits and how to assign them a probability of being selected.
After that, how do you link this simple workflow to a button?
Thank you to all of you for your help!