Home>

I want to control the randomness of processing.
For example, a square is displayed on the left with a probability of 80% and is displayed on the right with a probability of 20%. How can I write such a code?
Thank you.

  • Answer # 1

    Generate 0 to 9 with random number generation function (10 ways)
    I think the right way is 0 and 1 and the other is left

    #However, the quality of the random number function may not go that way