This is where to me, working out an outline that can work.. and I may spend hours over days planning the outline is easier than drawing diagrams. When I have the outline right, it provides me with comments to code between. It’s not the best way possible but it works for me.
what do you mean by outline?
a state machine is just one tool for capturing and refining a design. i find data flow diagrams very useful.
Diagrams are easier to draw and verify. But your diagram and label style is quite inappropriate, e.g. does not handle direction changes very accurately. The other diagrams shown will allow to find or avoid such errors much easier.
For the whole program, verbose pseudocode to become comments.
If the code needs to do different, the comments must change too. I saw so much of comments unchanged by my 2nd year coding that I ignored them and adopted the view that the code is the comments, and Reagan was still President.
I hash out how the code should work by making an outline and revising the hell out of it at that level before I write ANY code.
I may need to make some drawings or list text sequences and make notes on those. I may move coins around too.
A number of my examples have their outlines buried in comments.