Simulating Life

Just another UMass Boston Blogs site

Code Review

| 1 Comment

 

This portion of the code is under the pig tab. It tells the pig that if it is pink and it collides with a human that is red and infected, it has a 5% chance of turning red.

If it is pink and collides with a bird that is blue and infected, it has a 5% chance of turning blue.

If the pig is blue and collides with a red human, it has a 5% chance of turning orange, which is the H1N1 virus.

If the pig is red and collides with a blue bird, it has a 5% chance of turning orange.

When I press setup and forever, the simulation seems to be following these directions so I just wanted to show and and make sure it’s correct.

One Comment

  1. looks AOK to me!

Leave a Reply

Required fields are marked *.


Skip to toolbar