waaronmorris / CS162_Group_15_Project_1

0 stars 1 forks source link

Ant Breed Function #2

Open waaronmorris opened 6 years ago

waaronmorris commented 6 years ago

If an ant survives for three time steps (not been eaten by doodlebugs), at the end of the time step (i.e., after moving) the ant will breed. This is simulated by creating a new ant in an adjacent (up, down, left, or right) cell that is empty randomly. If the cell that is picked is not empty, randomly attempt to pick another one. If there is no empty cell available, no breeding occurs. Once an offspring is produced, an ant cannot produce an offspring again until it has survived three more time steps.

waaronmorris commented 6 years ago

Should identify the space and use the factory function in the Board class to generate the new Ant.