~ The Fractal gennarator~
Link to see: http://hk.geocities.com/kwan_ism001/my_project.html
Download the source code: kwan_project.doc
If you feel interest about this project topic ,you can read more detail from this website:
Link to see: http://hk.geocities.com/kwan_ism001/my_project.html
Download the source code: kwan_project.doc
If you feel interest about this project topic ,you can read more detail from this website:
Player.java : http://pastebin.ca/813054
FightersUniverse.java : http://pastebin.ca/813057
BossPlayer.java : http://pastebin.ca/813058
******************************************
This is an advanced fighter game.
There are four players.
Two of them are ordinary players.They are Andy and Peter.
The other two are boss players.They are Rain and Elsa.
For this time,the initial power is 10.
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.
If the power to be reduced is not an integer.e.g.2.5,it will rounded down to 2.
If the difference is zero , difference is 1.This is same as the simple fighter.
When any player’s power is negative,the player is dead ><
The game will stop
Then print out “Game over” and each players’ power…
******************************************
Java Simple Text Fighter! v20070928
========= Round1 =========
Player Andy ’s power = 100
Player Peter ’s power = 100
Andy attacks Peter!
Congutulation ! Andy wins !
========= Round2 =========
Player Andy ’s power = 101
Player Peter ’s power = 99
Andy attacks Peter!
Sorry ! Andy loses !
========= Round3 =========
Player Andy ’s power = 97
Player Peter ’s power = 103
Andy attacks Peter!
Sorry ! Andy loses !
========= Round4 =========
Player Andy ’s power = 103
Player Peter ’s power = 97
Andy attacks Peter!
Congutulation ! Andy wins !
========= Round5 =========
Player Andy ’s power = 97
Player Peter ’s power = 103
Andy attacks Peter!
Congutulation ! Andy wins !
========= Round6 =========
Player Andy ’s power = 91
Player Peter ’s power = 109
Andy attacks Peter!
Sorry ! Andy loses !
========= Round7 =========
Player Andy ’s power = 73
Player Peter ’s power = 127
Andy attacks Peter!
Sorry ! Andy loses !
========= Round8 =========
Player Andy ’s power = 127
Player Peter ’s power = 73
Andy attacks Peter!
Congutulation ! Andy wins !
========= Round9 =========
Player Andy ’s power = 181
Player Peter ’s power = 19
Andy attacks Peter!
Congutulation ! Andy wins !
Peter is killed!
======= ! Game over! ======
Player Andy ’s power = 343
Player Peter ’s power = -143
******************************************
******************************************
————————————————————–
// exercise 2.25: Remainder.java
// Remainder program that determines an integer whether it is odd or even
import java.util.Scanner; // program uses class Scanner
public class Remainder
{
// main method begins execution of Java application
public static void main( String args[] )
{
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int number; // number to deterimine
int remainder; // remainder of number
System.out.print( “Please enter an integer: ” ); // prompt
number = input.nextInt(); // read number from user
remainder = number % 2; //remainder
System.out.printf( “Remainder is %d\n”, remainder ); // display remainder
if ( remainder == 0 )
System.out.printf( “%d = even number“, number );
if ( remainder != 0 )
System.out.printf( “%d = odd number“, number );
} // end method main
} // end class Remainder
————————————————————–