OOPortal OOPortal


Eco Simulation  «Prev 

Writing your Own Simulation - Exercise

Writing your own simulation


Objective: Write a more robust ecological simulation program.

Instructions


Use the basic components of the simple ecological simulation program presented in this module to design and code your own version.
The exact specifications of the program are up to you, but there are a few minimum specifications beyond what you have examined and written so far in this module:
  1. Add the ability for users to determine the size of the world and the number of cycles.
  2. Create more complex interactions between your lifeforms.
  3. Provide each lifeform with a display character so users can tell the lifeforms apart when the world is displayed.
  4. Automatically end the simulation whenever all squares are empty.
  5. Provide clear, well-commented code so it is very clear what enhancements you're making to the simulation.

All the code you have examined for the ecological simulation program is also available in the following files, which can be found in the compressed course download file available on the Resources page:
  1. worldmain.cpp
  2. living.cpp
  3. worldactions.cpp

The course tutor will be choosing the best student submissions for the course project and posting the code in the Course Project Discussion area.
Paste your code below and click the Submit button when you are ready to submit this exercise.