Which prawn is helpless ~~~~~ Wonglun! ! ! Send 100 points

xiaoxiao2021-03-06  16

topic

Simulate a small ecosystem.

Claim

In a small ecosystem, there are several organisms, including different animals and plants, together form a biological chain. A program system simulation the ecosystem is now needed. Specific description is as follows:

1. Select no less than 8 creatures according to their own biological experience and common sense to constitute an ecological chain.

2. Define a class for each organism.

3. There is a certain commonality between some species, please define its parent classes and derive it from it. All classes are derived from the Organism class.

4. There is a predation relationship between the organisms. In order to simplify the system, assuming that the big creature is small, it will directly lead to the death of small organisms. If a small organism can eat a big creature, it will lead to the death of the big organism after several times. Each organism has a corresponding life range, and life is naturally died.

5. Each other time unit, randomly select a certain amount of organism for prey, predation objects are also selected randomly, and the feeding volume is randomly floated up and down under the range set by the biological itself.

6. Each organism has breeding capabilities. In order to simplify problems, the gender problem of creatures is not considered, using single propagation. Propagation situations are randomly floated according to the breeding capability and breeding cycle of each organism and the maturity period.

1. Define the classes needed and achieve their behavior.

2. Realize the predation relationship between various types.

3. Improve the simulation of breeding of various types of organisms.

Developed by Borland C 5.5 or GCC

转载请注明原文地址:https://www.9cbs.com/read-67775.html

New Post(0)