The week before reading week was a busy one: finishing A1, doing two other midterms, and in the meantime trying to process the new information we were learning about trees in class. Out of all of these tasks, I found Assignment 1 the most enjoyable. I had already completed the bulk of the assignment and in the few days before it was due, I mostly just needed to write the code for the tour of four stools, and (my favourite...not): docstrings!
The hard part about writing the tour of four stools function for me was keeping track of all the different stools throughout the recursion. I traced out the code on several pieces of paper before I finally figured out how to write it. The hardest part was figuring out which intermediate to use as which parameter in the function - although in the end it didn't really make a difference. My function worked for up to 20 cheeses (and is probably still calculating the result for 100) so I hope I'll do well on this assignment. Speaking of which, I have been anxiously checking MarkUs every day for the past week, but expectedly, no marks up yet.
The part of A1 I found the most difficult was the function where you asked the user for input, to play the game manually from the console. This is another example of the big leap from 108 to 148: in 108, we were supposed to assume all user input would be of the correct format. It took a while and several if statements, but eventually I got a functioning way to play the game.
In class we learned about trees. I found trees to be the most difficult use of recursion to understand that we've seen so far, because we were creating a class that was defined recursively. I'm interested to see what we will use trees for, as I've heard that they are used a lot in more advanced programming.
Now that that's all done, time to study for the midterm!
Good luck everyone!
