CS212 Grades
Comments after Problem Set
5

Overall Thoughts

Whew, that one's done!!! Well, we had a lot of fun writing this and grading this, so hopefully you enjoyed it as well. The mean again was good, so keep up the good work.

Warning

We had several problems with students posting solution code to the newsgroup. From now on, anyone who posts solution code to the newsgroup will lose ten points from their overall grade for each hour the code is up on the newsgroup. Hopefully this will be enough of a deterrent to prevent anyone from posting solution code to the newsgroup again.

Watch out for this!!!

We introduced set! to you in hopes that you would remember all the nifty things you could do without it. Interestingly, you could have solved problems 4-6 efficiently without using set! in your code.

The higher order functions map and filter are meant to return values. If you want to do something only for side-effects, you should use for-each.

General Things You Could Improve Upon

Commenting dramatically improved, but we are still seeing some useless comments here and there. It's been mentioned a few times, but this is worth mentioning again - choosing good variable names is much more important than commenting.

Try to emulate the style of code that we provide. With 3000 lines of code, you had a lot to go on. In particular, you should try not to reimplement things that are already available to you. Part of the problem was to figure out how a plan works, and using it correctly is really cool.

Notes about the Problems

You really don't need a <reaper> class. If you are creating specialized generic methods, you can use the singleton class of chr:reaper to achieve any specific dispatch.

When creating a plan, you shouldn't be using insert-event to put the event in the queue, that's why there is an animate loop.

The commands you add for <wheelbarrows> should work for all wheelbarrows, not just one instance of <wheelbarrow>.

You only needed to specialized (fight (a <animate>) (c = chr:reaper)). The other way around is unnecessary since the reaper's plan could just call (kill a) instead of (fight r a). If you think about it, you could save two function calls.

Specializing the kill method for <ducks> is quite unnecessary and often wasteful.

You could have let queue-top do the error checking for dequeue.

Several of you broke the abstraction for <queue> - not a good idea at all. <queue> should only be interfaced with methods defined in the queue.ss interface.

A Note about the English Language

We want you to know the difference between its and it's. Its is the possessive form of it, while it's is the contraction for it is.

Solutions and the Winner

Considering that Problem Set 5 will change for future semesters, we've decided to post sample solutions to problem set 5. It would be a good idea for you to compare your solution to ours and see how they differ. Remember that there is a lot of latitude in how you could have solved these problems - this is just one way of doing it.

Problem Set 5 Solutions

After the course staff finishes debugging the contest submissions, we will release an update that includes several of the clever contest entries. We may also try to setup a server for students to login to, if you want to try the game out and play against each other.  Congratulations to Brian Dunstan for winning the Cool Extension Contest.  Take a look at what he did:

Problem Set 5 Game Extension Contest Winning Entry