Identifying errors in algorithm design
Errors in algorithms are just a fact of life for any coder. It's important to get comfortable with making mistakes. As mentioned in Chapter 5, Exploring Problem Analysis, and Chapter 6, Solution Processes and Design, it's good practice to test your algorithm and test it often. Waiting until you have finished hundreds or thousands of lines of code to test something is a recipe for disaster. And yes, I was once working on copying a game and did not test at all. Not until I had all 4,585 lines copied. I was young. Truth be told, I never found the error I made. I started over and started testing at every corner. The second time was successful, but I'd wasted weeks copying everything (it was from a book—GitHub wasn't a thing yet) and then trying to figure out the errors. So please don't be me. Please test your algorithms.
Now, before moving on to debugging and working with codes, let's take a look at the errors...