Hi, so.. i know the code below would produce 20 random numbers between 0 and 1.. but is there any way i can make the loop stop after having 3 consecutive numbers? like after having three 1's or three 0's in a row??
Thank you in advance!
I just tested the program, and it worked just as I wanted it to! Thank you so much Repeater and Keskiverto for the help!
(By the way, I had to change the 3 to 2 in the line below because when it was 3, the loop stopped after having 4 consecutive numbers instead of 3. But other than that, everything worked perfect! :D)
while ((++generatedSoFar < 20) && runningCount < 3