4a: In lesson 4a we learned a lot about pseudocode and flowcharts. I feel like the pseudocode was fairly easy to pick up because it was basically writing code in basic english, which shouldn’t be too difficult. However, the different shapes of the flowchart confused me a bit, but I think I understand it now. Coding the password checker was easier than I expected because the code used wasn’t anything beyond what we had learned and was a very cool combination of the concepts. However I didn’t manage to figure out how to cut off the attempts at 5 so that is one thing I need to work on. The guess the number game was much more difficult than I thought it would be because I was missing an essential part from my code. My code was fine except that I didn’t assign a new integer for every guess. This caused the computer to say lower or higher for every guess because every new guess didn’t matter to the computer as only the first guess was being processed. I managed to fix that and set up a counter for the amount of guesses. The things that I now need to work on are stopping the game after 5 guesses and adding a play again function.
4b: In this lesson I learned a lot about functions and I really needed to know how to use while loops and if else statements and all variants of this. I first needed to make sure I had a counter that was counting down from 5, so that I know how many guesses are left for the user. I also needed to figure out how to stop the game when the 5 guesses were up which was fairly simple. I had to make an if statement and put a break when the counter went below one. This made the game stop. The play again function was a bit harder though because I had to figure out how to define the function of restarting and then putting my entire code inside of it. I didn’t manage to figure out how to write a text file so I could look into that more in future projects.