Inspiration

We are currently living through an unprecedented outbreak, that is unlike anything most of us have seen in our lifetime. In the face of it, we have been asked to maintain physical distancing, as well as reduce unnecessary travel. To model what would happen without this, I created a simulation to show how quickly a virus like Covid-19 could spread.

What it does

The simulation uses a manipulable R0, in between 2.2-2.7 (the currently published values by the CDC), to simulate the spread of the virus. Every 1/8 second a 'day' passes in the simulation, and the virus is spread. A black sprite represents a carrier or a healthy 'person'. A red sprite represents someone that is symptomatic. A grey sprite represents someone that died to the virus, and a cyan sprite represents someone that recovered.

How I built it

I used my prior knowledge of Javascript, as well as HTML5, and CSS to make this all come together.

Challenges I ran into

I ran into several challenges. The funniest of them was that I had a bug that at one point caused the 'virus' to spread only diagonally, which ended up being me trying to be clever coming back to get me.

Accomplishments that I'm proud of

I'm proud of the fact that I got this project done, as this is my first hackathon, and I chose something that required me to go outside my comfort zone in Javascript.

What I learned

I learned how to use the interval methods from the DOM. In addition I strengthened my skills working with array manipulation as well as developing my own classes.

What's next for COVID-19 Simulator

I plan on rewriting the css, to make the page much more approachable. Furthermore, adding a mode to the simulator to simulate social distancing would help give the message.

Built With

Share this project:

Updates