RU beehive logo ITEC dept promo banner
ITEC 380
2008fall
ibarland

homeinfolecturesexamsarchive

hw03
Scheme project

Due 2008.Sep.26 (Fri) in class. Turn in: a hard-copy of your programs, as well as an electronic copy of a single file (suffix “.ss”) on Blackboard(WebCT).

Update Sep.22 (Mon): By popular demand1, you'll turn in the entire homework Sep.29 (Mon), but the following is due Friday. Note that each bullet is at most 6-7 lines (including comments), and most are only 2-4 lines. With examples of the data and test cases, at least one (if not two) examples should be a simple as possible.

In addition, I recommend by Friday: See WebCT/Blackboard, for hw03a-soln.ss.

See scheme-resources—ITEC380 Scheme resources for reading links, and information on running scheme.

  1. Complete the the fire-fighting-game.
    If you wonder exactly which symbols your function process-keys might be given, you can see the key-event documentation (in the world teachpack). (Note that this leads you to discover a function for comparing two keys which is better than either char=? or symbol=?, but won't ignore bad inputs like eq? or equal? do.)
    If you want to modify your airplane struct/functions from hw02, you can (but it's not necessary).
  2. After you get the game working, modify it so that water-droplets which are “below the ground” are removed.
  3. For fun: If you (require scheme/gui/base), you can then use play-sound.
  4. Generalize insert-sort to take two arguments, the second being a comparison function.
  5. Extra credit: read about opt-lambda3. Then, modify your insert-sort to take either one or two inputs. Points are only given for well-designed code (don't repeat code unnecessarily!)
  6. Programming Exercise 15.8 (subst-in-tree).
    Note that this is (slightly) easier than the file/folder example to be covered in lecture.
    Extension allowed: We did barely talk about mutual-recursion at the end of Friday (the descendent-tree program). This exercise is the same idea, though you need to interpret the book to get the data definition. If you want to turn this problem in with the next homework, that's acceptable.

1Well, actually, at Adam's demand. But I'll posit Adam is popular :-)      

2 Technically, since we don't update objects/structs: it returns a new fire which is similar to the one passed in.      

3You will need to (require (lib "plt-pretty-big.ss" "lang")) in order to use opt-lambda from the Advanced-student language.      

homeinfolecturesexamsarchive


©2008, Ian Barland, Radford University
Last modified 2008.Nov.05 (Wed)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme