Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

5 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

In the world of quarantine!

Beginning

The sea isolates each continent, but infected people have spread even before the warning. You have a map of the world at the beginning of the pandemic:

const pandemicStartMap = "XX0X10010X000X010X0";

A map is a string that contains three types of characters:

0 - uninfected
1 - infected
Х - ocean

Rules

  • The virus cannot spread to the other side of the ocean;
  • If one person is infected, everyone on this continent is infected;
  • Your task - to find the percentage of the population that eventually became infected.
  • ❗❗ The first and last continents are not connected!

Task

You need to display the result on the page. You need to have two maps, where a map can include one of the following cells:

  • Red cell for infected;
  • Green cell for uninfected;
  • Blue cell for the ocean.

Page structure:

  • Map before infection;
  • Map after infection;
  • The total number of infected areas on the map (excluding the ocean);
  • Infected count;
  • Percentage of infection.

Important

❗❗ Statistics and map after infection should be calculated via JavaScript based on initial data (variable pandemicStartMap)

Example

const pandemicStartMap = "01000000X000X011X0X";

./docs/pandemic-example-image.jpg

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

5 watching

Forks

Releases

Packages

Contributors