USAComment.com
Mmm Zicutake USA Comment | Search Articles


HTML> Simulation of a Virtual Pest

Virtual Pest "Startup Kit"

This page presents a "skeleton page" for a "minimal virtual pest" for use in CS 390:61-70, Fall 1999, assignments Virtual Pest I, Virtual Pest II, Virtual Pest III.

Included in the page source are functions that:

  • initialize the pest's state,
  • display indicators of the pest's state in the text boxes,
  • react to button clicks as appropriate,
  • update the pest's state according to the finite state machine and behavior table shown at the bottom.
You may use these functions as guides to programming your own virtual pest.

Tralfaz, the Wonder Dog

Tralfaz behaves according to the finite-state machine and behavior table shown at the end of this document. There are four possible states. The state is updated once per second.

Click the button to pat Tralfaz when state is either "lonely" or "angry". When "happy" or "provoked", the state changes randomly; clicking the button will have no effect in these states.

Sound:

Action:

The pest's state: Normally, this item is hidden Step counter:

Nenhum comentário:

Postar um comentário