All pastes #1265529 Raw Edit

Stuff

public java v1 · immutable
#1265529 ·published 2008-11-24 02:35 UTC
rendered paste body
/* * OOP Project 2 Fermi Game * Object Oriented Programming * * File: fermiGame.java */  public class fermiGame { 	 	public static void main (String[] args) { 		 		Fermi fermi = new Fermi();		InputInt inputInt = new InputInt();		InputString inputString = new InputString("Continue Playing ? (Y/N) :");		inputString.setRegExp("[YN]");				int userInput[] = new int[3];		int attempt;		Boolean play, winner;		String keepPlaying;		play = true;					  		System.out.println("\t\tFermi Game");		System.out.println("==============================================");				while(play == true){						System.out.println(fermi.getGameAnswers());						attempt = 1;			winner = false;						while ((winner == false ) && (attempt <= 10)) {								userInput[0] = inputInt.get("1st Digit : ");				userInput[1] = inputInt.get("2st Digit : ");				userInput[2] = inputInt.get("3st Digit : ");								fermi.letsPlay(userInput);								System.out.println("\nResults :");				System.out.println(fermi.getResults() + "\n" );								attempt ++;				winner = fermi.winner(userInput);				}								if (winner == true){				System.out.println("You won after " + (attempt - 1) + " guess.\n\n");				}else{				System.out.println("You lost.");				System.out.println("The correct answer was:");				System.out.println(fermi.getGameAnswers() + "\n\n");								if ((inputString.get()).equals("N")){				play = false;				System.out.println("\nThank-you");				}								System.out.println("\n\n\n");				 	 			} 	}  }}