when i run my project in java. i keep getting this stuff.
No Console ..... I dont know how to get console in eclipse.
here is my code.
import java.io.*;
public class WordGame {
public WordGame()
{
}
public static void main (String args[])
{
String WordGuess;
WordJudge gm = new WordJudge();
gm.pickword();
Console c = System.console();
if (c == null){
System.err.println("No Console.");
System.exit(1);
}
while (!gm.gameEnded()){
gm.displayWord();
System.out.format("You have %d attempts remaining. \n", gm.getRemainingGuesses());
strGuess = c.readLine("Enter your guess : ");
gm.judgeGuess(WordGuess);
}
if (gm.plyrwin()){
System.out.format("You won ! It took you %d attempts. \n", gm.nGuessesNeeded());
System.out.format(gm.GetTheWord());
}
else{
System.out.format("You lost. The word was %s \n", gm.GetTheWord());
}
}
}
please help me ... badly needed your reply ASAP. Tnx in advance guys.