Hi, I started a mini project that I thought would be interesting and not too hard (I’m new to programming), I’m trying to make a heads or tails program that lets you flip many coins at a time. Everything is perfect except for at the end I want it to tell you what the biggest streak was as in the highest amount of the same result in a row. I can’t figure out how to get this working can someone help? Here’s my code: https://hatebin.com/eohkykccff
you need more variables. 2 to keep the max streak of heads and tails, 1 to keep the current streak (no specification as to heads or tails, because there is only one current streak) and another to keep track of the last flip, heads or tails. (Initially it will be indeterminate, so 0-none, 1 heads, 2 tails for example.
Then think what you would do in real life. In fact, do it in real lif, and formulate the steps needed to do it, write it ib paper. How do you keep track of a streak, what do you do when the streak chamges? (Hint, you compare to something, you increment something, and then you reset something)
You’re halfway there, don’t give up!
Ok thanks, I’ll try to do this 🙂