The audio in the videos should be fixed now! Sorry about that!
This lecture presents a sample program that implements a "Pirate Treasure" game using C-Style ADTs and many of the programming techniques we've seen in the course so far. We also cover several debugging strategies to track down bugs in the program.
This lecture is shorter than usual - the live lectures are running behind schedule (turns out we tried to pack to much into the first several lectures…) and may not present this material. It's officially considered optional, but you may find the debugging strategies particularly helpful to apply to your own projects. (You can still earn participation credit for this lecture by answering the question following the first section.)
I didn't get this lecture out as soon as I would have liked, so I've extended the participation deadline until Friday at 11:59pm.
1: Pirate Treasure Program Overview
1.1
Here's an overview of where things are in the "Pirate Treasure" program with a few comments on overall program design. I go through things pretty quickly and without all the details, but the intent is primarily to orient you to what parts exist so that the debugging strategies below make more sense (don't worry if you're not quite sure about how everything works). The code lives in a public repository at https://github.com/jamesjuett/pirate-treasure. You're welcome to browse through it if you like, but it's not required for the lecture.
1.1
Select one of the answers below for participation credit. |
2: Debugging
Now, let's look at several debugging strategies applied to the "Pirate Treasure" program. First, we'll take a look at running the overall Next, we'll take a look at some defensive programming techniques, including using assertions, to detect bugs earlier and make them easier to fix. Finally, we'll get more information about what exactly the program is doing by adding breakpoints and using print statements so that we can figure out what is happening to cause the last few bugs. |