It seems as though recursion is going to be a recursive theme in my SLOGs.
*sigh*
Seeing as we just completed the second assignment, I realize that recursion is not as simple as I thought it was. Despite our team's struggles we were still able to get together and work through a solution. Our minimax strategy code worked great for subtract square but it struggled when it came to playing tippy. We believe our code for recursion was well written and it could not have been possible had it not been for the strategy we used in our many lectures and labs. One of which is to have two cases; one which is simple enough to not require recursion and one which needs recursion to properly solve it. For the first simple case, we simply write an if statement which would apply for it but not for the more complex case. As for the recursive case, we write an else statement which takes advantage of recursion and uses the incomplete function to complete it (if you know what I mean).
On the other hand, fellow SLOGer Antiaromatic pointed out that recursion problems can be seen as "trees" and I completely agree with them. Though at times it might not be necessary to literally make a tree to use recursion, having a multiple-depth list in a tree-like manner can work just as well.
Oh and our TAs are on strike.
No comments:
Post a Comment