...

/

Sunflower vs Zombies Game Simulation

Sunflower vs Zombies Game Simulation

Create a simplified version of the famous Plants vs. Zombies game.

Problem

This is a simplified simulation of the famous “Plants vs. Zombies” game. A sunflower is on the left of the field, and zombies come towards the sunflower (to eat it) one by one from the right side of the field. The purpose of the game is to have the sunflower survive one wave of attack (1515 zombies).

For each step a zombie makes, there will be an exchange of fire (the sunflower shoots seeds at the zombie; the zombie throws stones at the sunflower), and both the sunflower and the zombie receive a certain degree of damage to their health. If the attacking zombie’s health goes down to 0%, the zombie dies and then another one comes until no more zombies remain. If the sunflower’s health reaches 0%, ...