The code tags button looks like this <> and is on the right under format: Select your code then press the <> button. You can also do quotes, like below, and program output.
I'm pretty sure the infinite loop is needed to constantly update the board and show the characters moving |
.
If you want to loop, put the code in a while loop, don't have an infinite one - it's unnecessary and very bad. Use a while loop in conjunction with a bool variable to help decide when the loop terminates.
Functions help split up your code into smaller jobs, so instead of having 200 lines of code in one go, you can split it up. This is especially handy for reuse of code. Example Drawing the board could be a function.
What I do is write down the methodology (all the steps to carry out) as comments. This helps organise your thoughts and get things happening logically. You can start with very general ideas first, then go back and refine them with more detail. You can repeat this process until you have everything sorted out.
Then go back and write code that does what's written in the comment, leave the comments there as they serve as documentation.
The comments can also help you see which code should go into a function.