In the other hand, there are four player here. Two of the player are the boss. That means the defense and attackment of boss is more than that of other players.
The rule:
There are four players, each with an initial power of 10. Two of them are ordinary players and the other two are boss players. In each round, one player is selected by random to attack another random player.
If a player chosen is already dead in previous rounds, or a player is selected to attack himself/herself, then select another player.
The rules of attack are the same as in the previous homework, except for the following:
Boss players are more resistant to attacks. When they lose an attack, they only lose half the amount than an ordinary player. For example, consider that boss player Janice and ordinary player Ho Yin have 40 and 60 points of power respectively before the attack. If Ho Yin wins the attack, then Janice would only lose half of the power difference (i.e. 0.5*difference).
Boss players gain double the power difference on win. For example, if boss player Janice wins in the above example, she should gain 2*difference.
Sample of output:
You can download the file here:
BossPlayer: BossPlayer.java
Player: Player.java
FightersUniverse: FightersUniverse.java
Or you can download the source code as a zip file: FightersUniverse.rar