How to run the program?

Step1: open Start(開始)
Step2: open Run(執行)
Step3: input "cmd" into the textbar and then press "Enter"
Step4: Compile both files (e.g.javac Compiler*.java) and run file (e.g . java CompilerTest).

10月 18, 2007

Lingnan Fighter

There is an exciting game!! It is called "Lingnan Fighter". In the game, there are two people that they will fight each other in random. You can see that there is a special thing:

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

Sample of output:

Round 1
Player Ho Yin's power = 100
Player Jenifer's power = 100
Ho Yin attacks Jenifer!
Jenifer wins
Round 2
Player Ho Yin's power = 99
Player Jenifer's power = 101
Ho Yin attacks Jenifer!
Ho Yin wins
...
You can download the file here:
Player.java: Player.java
FighterTest(main program): FighterTest.java

Or you may download the source code as a zip file:Lingnan Fighting