From user input of either char a or char b as an answer.
I want to return a value of true or false from user input.
Then count the number of selections between two possibilities per individual user input.
Then force it to randomly return false 3% of the time.
The purpose is to alter the expected outcome with a reward.
How do I go about doing this? I am new to this concept.
Math.random(), which gives you a random number [0,1). You want
false 3/100 times, so if you multiply your random number by 100, your range will become [0, 100). Then just check if the random number is less than 3, if so, return false.