I'm working on a hangman assignment, but I am stuck in one part of it;
A player (user) is playing a game of words with the computer. The users plays the game couple of times. When they stop the overall score of the user is displayed . Each play the user sees a menu.
String S;
int s2;
System.out.println("WELCOME TO WORD GAME V.12.01.16");
System.out.println("****MENU****");
System.out.println("FIRST YOUR NUMBER AND PRESS 'ENTER' ");
System.out.printf("0:Stop \n 1:Name \n 2:City \n 3:Animal \n 4:Thing ");
s=input.nextInt();
if(s==0) {
System.out.println("GOODBYE");
}
for(int i=0;i<category.length;i++) {
if(s==i){
System.out.println("GUESS FOR 1,CHARACTER FOR 2");
s2=input.nextInt();
if(s2==1){
System.out.println("ENTER YOUR GUESS");
S=input.nextLine();
boolean result=correct(S);
if(result==true) {
System.out.println("Congrats");
}
}
}
}
}
public static boolean correct(String X) {
for(int i=1;i<5;i++){
for(int j=0;j<10;j++){
if (category[i][j].equals(X)) {
}
}
}
return true;
}
}