CS 390:61-70 Fall 1999
Homework 7 -- Virtual Pests, Part III
Due Date: Tuesday, Nov. 30 in class
This is the final part of a three-part assignment. The
requirements for the were for you to design a virtual pest and its
behavior. The requirements for the were for you to implement the user interface and
design the structure for the software that implements the behavior.
functions and statements.
Using the table of behaviors you specified in Parts I-II as a
guide, complete your virtual pest by translating these to the
Also upload your completed pest to your course website and supply
the URL (on your gradesheet).
As discussed in class, you need to link your form elements to
functions so that the values of the form elements may be transferred
to the function for processing, then back to the form for display
purposes. See the class lecture notes on and for more details on accomplishing this.
A has been provided for your assistance in this
regard. Several points are worthy of note:
- The sample pest contains minimal functionality - just enough
to illustrate all key points, and not enough to fulfill the
requirements for the assignment.
- The sample pest contains functions Init(),
ShowState(), Pat(), and Simulate(),
- initialize the pest
- update the display to reflect the pest's state
- handle the "Pat dog" button click event, and
- continues cycling through states according to the pest
- The script is heavily commented to explain the way the
functions work and interact.
- The pest's HTML form contains a text box named "state" that
shows the pest's state at all times. Normally, after testing, this
would be hidden. Follow the directions in the comments to hide
this text box (DO NOT REMOVE IT, JUST HIDE IT!!!) when testing is
- The pest's HTML form also contains a text box named "counter"
that counts the number of times the Simulate() function
has been invoked. This is not needed, but is useful in testing so
that it is obvious that updates are still occurring even when no
state changes occur (as in when the sample pest is "lonely" and
waits for the owner to click the "Pat dog" button.
- Follow the directions in the comments to hide this text box
(DO NOT REMOVE IT, JUST HIDE IT!!!) when testing is complete.
- The sample pest also shows the original finite state machine
and behavior table. This is for illustrative purposes only - your
pest should not include these here.
You should upload your virtual pest to your website and provide
its URL on your gradesheet.
WHAT TO HAND IN:
- Your cover sheet will be a "grading sheet" created for use
with this assignment. Generate a grading
sheet, input your own information, save it, and print it
- Print out your virtual pest form.
- Print out a written summary of the behaviors you originally
specified, and a description of any differences in your final
product from your original design.
- Print out a written description of any elements you have
included which go beyond the requirements of the assignment, to be
considered for bonus points.
virtual pest form.
- ATTACH A DISKETTE CONTAINING YOUR VIRTUAL PEST. INCLUDE
YOUR MATERIALS FOR PARTS I AND II ON THIS DISK ALSO.
You must do this work yourself. If you need assistance with this
aspect of the assignment, see a consultant during consulting hours.
You are encouraged to seek any necessary help from other persons
regarding how to use your computer and accompanying software, in
accordance with the stated course policy.