Project 10
Viral Outbreak
No one likes to be sick, not even a turtle! Viral Outbreak is a simple simulation that models catching a cold in a population of turtles. You begin by coding a single turtle to move and react to the background and other turtles — and then clone that turtle, creating as many turtles as you want.
When a turtle gets sick, it infects other turtles that it bumps into. But if a sick turtle wanders into a hospital, it becomes well again. You can change how fast the turtles roam around and the size of the hospital, as well as add other new features to make your model even more realistic!
Brainstorm
We often hear of something going viral. Although the original meaning involved the rapid spread of a virus, these days “going viral” applies to anything that spreads through a network of people, places, or technology. Consider some of these ideas as your subject matter when building Viral Outbreak:
- Sharing of a YouTube video or Facebook post, with colliding turtles sharing a post, and the popularity of the post increasing as more turtles receive and share it
- Retweeting of a Twitter post, with an infected turtle tweeting, and every turtle it bumps into receiving the tweet; those recipients then retweet when they bump into other turtles, and so on
- Spreading popularity of a fashion accessory: an infected turtle wears an accessory, and any turtle it bumps into copies its style by wearing the same accessory, and so on
- Transmission of a computer virus through email, with ...
Get Coding For Kids For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.