Share your repls and programming experiences

← Back to all posts
Simulator of Spread of COVID-19
adhvaiththurvas (28)

Hi guys,
This is my first post. I was looking at the news (with coronovirus spreading and mass panic ensuing) and decided to make a little simulator of the spread of coronavirus based on infectivity rates and mortality rates. This isn't complete, I'm still adding stuff to this to make it more accurate, but it's pretty good for now. Hope you guys enjoy it!

roylatgnail (771)

Good job! One thing I would recommend is to remove using namespace std;, as that is a bad practice

nt998302 (104)

@TaylorLiang It's not really a bad practice in replit. I'd say, having experience in UE4 and Unity, that it is most important to remove in software development and Game Dev, but otherwise, it's a nice thing to have for time's sake.

roylatgnail (771)

@nt998302 for something small, I would agree that yeah, its ok. Just that for larger projects, it can cause a hassle and errors later on

ChezCoder (216)

your feedbak thing doesn't work, clients cant change your server sided text files. it can easily solved with database packages or a database handling lang. (php, nodejs, etc...)

SilentShadowBla (503)

C++ should be used more, this is awesome

Mapaor4 (3)

How do you program the Try again button?

Mapaor4 (3)

@SilentShadowBla Hey, I can't see the loop. The main funcion ends with simulation(people,day,num_of_ppl);

and at the end of this function we found:

cout << "Any feedback? (Must be 1000 words or less)" << endl;
    char feedback[1000];
    cin >> feedback;
    file << feedback << "\n";

So where exactly is the loop?

adhvaiththurvas (28)

@Mapaor4 the while loop is in the function simulation (vector<int> a, int day, long long int num)

Mapaor4 (3)

It's easy to win but really good code

adhvaiththurvas (28)

UPDATE: COVID-19 Simulator is now updated to 0.0.15 (Fuschia)

  • age is now a factor in the pandemic. There are a bunch of old people with twice as high of a mortality rate.
  • the objective is to get under a 3% mortality rate and try to get rid of the pandemic as quick as you can.
  • a few more features to make this more game-like

FUTURE: more features to be added, including the socio-economic effects of the COVID-19 pandemic and means of decreasing the mortality rate

AgastyaSandhuja (108)

I spammed "3" and won the game so you should add things to stop a spam for something that can easily win the game

adhvaiththurvas (28)


  • fixed bug where simulation wouldn't stop when no one is infected
  • increased "mass panic" threshold
    The infectivity rate is based on real stats, as well as the mortality rate. I am working on increasing the mortality rate.
    This is meant to be a simulation of a real COVID-19 pandemic, which is why I am adding more features, and why the infectivity rate/mortality rate isn't as high.
LiamDonohue (224)

i just did nothing the whole time lol

LiamDonohue (224)

It's like but for COVID

LizFoster (371)

It's a little bit too easy to win. Also, it doesn't automatically stop when the number of infected people hits zero. Maybe make the infection rate twice as high, or something like that? This is a very good idea, and well thought out if I may. Good work so far!