![]() |
![]() |
|
home—lectures—exams—hws—breeze (snow day)
Due Oct.12 (Fri) in class. (Do not wait until Wed. night to start this!)
Implement the functions below. Following those requirements is a discussion of ways our game can differ from the original game.
We're looking for a asteroids-like game, but we don't need to implement every feature of the original. In particular, it's acceptable to punt on the following issues.
Opportunities are rife for extra-credit, by adding additional features. Don't do this until you get the above functionality working, though!
Note: “function” is not a specific-enough type, although something like “number → boolean” is. Similarly, “list” is not specific enough6, but “(listof string)” is.
(4pts)
Write a function which takes in a list of strings (some of which might be numerals),
and returns a list of just the numerals, in descending numeric order
(with any leading zeroes removed7).
For example, given
Your function should consist of calls to
(4pts)
Write
Write your function without using
1You must require
the teachpack
2
Note that eventually, you'll want to provide big-bang an
3 If you prefer to use rectangles for bounding-boxes, see me for advice. If you want to use some other collision-detection approach, I encourage you to run it by me first. ↩
4 If you did want to go the extra mile and handle both key-release events (in addition to key-press events), it would presumably requires adding state to the ship representing whether or not it is currently in the middle of acceleration. ↩
5Or at the least, all code except for possibly one-to-two line snippets that are straightforward. ↩
6
The reason is fairly solid:
7
The removal-of-leading-zeroes is allowed, since
home—lectures—exams—hws—breeze (snow day)
©2012, Ian Barland, Radford University Last modified 2012.Oct.19 (Fri) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |