package proj2; import java.util.*; public class Project2 { // this main( ) steps through the game "displaying" cards and results // for each turn of the game public static void main( String[ ] args) { Scanner keybd = new Scanner( System.in ); // get player names from user System.out.println("Welcome to WAR!!"); System.out.print("Please enter player1's name: "); String p1Name = keybd.nextLine(); System.out.print("Please enter player2's name: "); String p2Name = keybd.nextLine(); // input Random Number Generator (RNG) seed and initialize the game System.out.print ("Please enter the RNG seed for shuffling: "); long rngSeed = keybd.nextLong(); Game war = new Game(p1Name, p2Name, rngSeed); int turn = 1; // while game is being played, print details and results of each turn while (! war.gameComplete()) { System.out.printf( "Turn %2d\n", turn); System.out.println( "-----"); System.out.println( war.nextTurn()); ++turn; } // all turn complete, print the game results System.out.println("Game Over!!"); System.out.println(war.gameResult()); } }