Traffic Counter Assignment (100 pts)

Write a "traffic counter" box that records who or what has passed through your room, when, and how many times, with a nicely formatted reporting verb.
  1. (5 pts) @create an instance of $g.traffic_counter named appropriately for your room; i.e. room #1234 would get counter1234
    YOUR number should be the number of your underground room. For example, "The Black Pearl (#8064)" uses "counter8064"
  2. (5 pts) Create a $g name for your counter, see http://cs.ndsu.edu/~slator/html/dollarg.html, (NO object numbers in code), for example
    ;$g:add_dollarg_prop("counter8064", YOUR-OBJECT-NUMBER)
  3. (10 pts) add an "enterfunc" function to your room that calls a 'traffic' verb on your counter, passing it the object that has entered your room (see How to Add Verbs for details).
  4. (10 pts) @describe your traffic counter as though it were a person or robot that 'belongs' in your underground lair
  5. (15 pts) Add a "traffic" verb to your traffic counter box. This verb should maintain at least a 2-place list (as a property defined on the counter box object) that records who/what has traveled through your room, and how many times.
  6. (10 pts)Have your traffic counter greet players differently if they are new or repeat visitors
  7. (15 pts) implement a "report" verb on your counter box that produces a nice listing of traffic in response to a player typing the command "report counter1234"
  8. (10 pts) Add WHEN to the report, i.e. " most recently at 11:36 p.m. on 02/06/03". You will want to read "help $time_utils" especially the functions AMPM and MMDDYY to do this, also 'help time()'
  9. (10 pts) Produce 'report' results in sorted order by 'most frequent visitor' or 'visitor name' or 'most recent visitor'
  10. (10 pts) @audit yourself and send reasonably commented code that to the relevant official (probably the TA for the course) along with a transcript showing output and messages. This document should be clear and explicit about what points you have earned, and for what exactly.
    The SUBJECT line of your email should say "CS345 ASSIGNMENT NUMBER 3"


Modified: 6feb03, 17Jan10, 22Feb11
Send comments to: slator@cs.ndsu.edu