[Solved] Debugging a Biased Coin Flip (C++)


You declared:

int FLIP_RESULT = rand() % 2 + 1;

at the start of your code. This means that the flip happens only once at the start of the program, regardless of the number of flips the user inputs.

Try randoming the FLIP_RESULT as first line of your for loop, and you’ll see it working.

0

solved Debugging a Biased Coin Flip (C++)