Basically I'm creating a color spinner command (red, green and black) for a casino bot and it works like this:
you can bet x amount on x color: !green wheel 500
and what I want to do is that the color black and red have a 40% chance of coming up while the color green only has a 20% chance.
I did the command, but all colors have the same chances, this is what I have so far.
One way to achieve this is to multiply the number of times the same option exists.
For example, suppose an array with all three colors.
The probability that either will come up is
33.33%
.Instead if, for example, we add again the
verde
to the array:Now the probability that the "red or black" comes out is from
25%
, while for the "green" it is from50%
.Using this form, so that the probability of "red or black" coming out is from
40%
( each ) and "green" coming out of20%
, we can do it like this: