function weightedRandom(max = 1, weight = 3, round = true) {
  let num = 0;
  for (let i = 0; i < weight; i++) {
    num += Math.random() * (max / weight);
  }
  return round && max > 1 ? Math.round(num) : num;
}
// produces an approximated normal distribution between 0 and max
produces an approximated normal distribution between 0 and max
produces an approximated normal distribution between 0 and max
function weightedRandom(max = 1, weight = 3, round = true) {
  let num = 0;
  for (let i = 0; i < weight; i++) {
    num += Math.random() * (max / weight);
  }
  return round && max > 1 ? Math.round(num) : num;
}
function weightedRandom ( max = 1 , weight = 3 , round = true ) { let num = 0 ; for ( let i = 0 ; i < weight ; i ++ ) { num += Math . random ( ) * ( max / weight ) ; } return round && max > 1 ? Math . round ( num ) : num ; }
produces an approximated normal distribution between 0 and max
produces an approximated normal distribution between 0 and max