Skip to content

berkguneey/CS-HeroSimulationProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CS-HeroSimulationProject

Hero Simulation Project

In the 23rd century the war between two empires led to a nuclear apocalypse which led to extinction of nearly all civilization and animal life. As we are the only survivors we are trying to build a new civilization but resources required to sustain life are rare. The radioactivity makes outdoors dangerous. We are living in an old bunker that is left from WW2. Volunteers need to get out to the dangerous lands and get to the places where they can get resources. Luckily the bunker we are living has an old radar that can find creatures on our path to the resources. As a surviving engineer you are required to write a simulation that can simulate if a volunteer can reach to resources. Be aware that our radar indicates that there are dangerous creatures and even zombies on the wasteland.

Write a simulation that find outs if the hero would survive or not. You can use the following sample input and output as a reference. If the volunteer hero faces an enemy he needs to fight against it until one of them dies. To simulate fights you can accept that enemy and the hero attack at the same time. hp represents health points. Each attack decreases health points equal to attack. To avoid radioactivity volunteer hero wears a special heavy armor that makes him walk meter by meter.

Sample Input:

Resources are 5000 meters away
Hero has 1000 hp
Hero attack is 10
Bug is Enemy
Lion is Enemy
Zombie is Enemy
Bug has 50 hp
Bug attack is 2
Lion has 100 hp
Lion attack is 15
Zombie has 300 hp
Zombie attack is 7
There is a Zombie at position 1681
There is a Bug at position 276
There is a Bug at position 489
There is a Lion at position 1527
There is a Lion at position 2865
There is a Zombie at position 3523

Sample Output:

Hero started journey with 1000 HP!
Hero defeated Bug with 990 HP remaining
Hero defeated Bug with 980 HP remaining
Hero defeated Lion with 830 HP remaining
Hero defeated Zombie with 620 HP remaining
Hero defeated Lion with 470 HP remaining
Hero defeated Zombie with 260 HP remaining
Hero Survived!

About

CS-Hero Simulation Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages