Re: help needed on inputting - tearing hair out .. please!!!



import java.util.Scanner;
import java.util.Random;


public class dice
{
public static void main (String [] args)
{
Scanner in = new Scanner(System.in);

Random rnd = new Random();


int correctguesses;
correctguesses = 0;

int r = rnd.nextInt(12) + 1;

System.out.print("guess a number ");
int x = in.nextInt();

if (x != r)

System.out.print(" Do you think the next number will be higher HI or
lower LO than " + x );

int y = in.nextInt();
String guess = in.next();

boolean correct = false;
if (guess.equals("HI"))
{
correct = ( x > y);
}
else if (guess.equals("LO"))
{
correct = (x < y);
}
System.out.println("The number was " + x + " and you guessed " + y +
" so you " + (correct ? "ROCK!" : "SUCK!"));




}

}

this is the program in its full, i am trying to capture input from the
text file.. thanks very much for your help

patrick

.