2007年10月18日星期四

ISM001 Assignment 1~Simple Text Fighter

Introduction:

This game is about 2 Players to Fighter together and looks forward which player win.

The rule of the game:

(1) The initial power of each player is 100.

(2) In each round of fight, the winner will gain the difference between the two players, and the loser will reduce the same amount of "power difference" at the same time.

e.g. player1 (80 power) attacks player2 (100 power), player1 wins. Then the power difference is 20, so the new power of player1 and player2 are 100(80+20) and 80(100-20).

If the "power difference" is 0 before the attack (i.e. both players have the same power), then use 1 as the difference.

(3) When the power of any player is negative, then that player is dead. The game end.

The java source code of FighterPlayer: http://pastebin.ca/740044

Here are the java file and class file:

The screenshot of the java output:

2007年10月17日星期三

Welcome to Tom Ho's Program Blog!!

This is my first post on this blog. I will sharing my program(although they are too bad=.=) in this blog. Welcome to visit!!