0

I was trying to make a randomizing array, but the thing is that the number 2 is chosen a lot (and it makes it Array[2]), here is my current code (it's rps):

const rps = ['Rock', 'Paper', 'Scissors']; 
//the next few lines are irrelevant
const chosen = rps[Math.round(Math.random()*3)-1] //usually returns Scissors

My goal is to find a way to randomize to have each of the choices with around 33% chance of being chosen (since 3 choices, 33.3%)

MrMythical
  • 8,908
  • 2
  • 17
  • 45

0 Answers0