Two worms fight into an arena : there can be only one !
-
Each worm has a name, life and attack points. [ok]
-
fight
- When a fight begins, each worm attack in turn,
- until one of them doesn't have any life point : life remaining is equals to current life point minus adversary attack.
- The rules stipulate that each turn, the worms with the lowest life points attacks first. If equal, the worm in first argument begins.
-
Return the name of the victorious worm !
You'll have to complete both Worm
and Arena
classes.
The arena only accepts worms with valid name, life and attack points : no need to check !