Hi i´m started to program a hangman game i Java not javascript i ecplice but now i´m stuck can anybode help me with the code so i can move forword just take the code and program it så it works PLEASE i cant anymore
import java.util.*;
public class GameLogic {
private boolean isStarted;
private int numberOfGuesses;
private int maxGuesses;
private List<String> guesses;
private String currentWord;
public void start() {
isStarted = true;
numberOfGuesses = 0;
maxGuesses = 7;
guesses = new ArrayList<>();
currentWord = "Hello";
}
public void quit() {
isStarted = false;
}
public void guess(String guess) {
// gissa på ett ord.
guesses.add(guess);
{
if (guess == currentWord)
System.out.println(" you win!" );
while (guess != currentWord)
numberOfGuesses = numberOfGuesses +1;
if (numberOfGuesses > maxGuesses)
System.out.println("You lose" + currentWord);
quit();
}
// koll om "guess" finns i (contains) order "currentWord".
// Om sådant inte är fallet,
// öka värdert på numberOfGuesses.
//if (numberOfGuesses > maxGuesses){
// quit();
}
public boolean isStarted() {
return isStarted;
}
public void setStarted(boolean isStarted) {
this.isStarted = isStarted;
}
public int getNumberOfGuesses() {
return numberOfGuesses;
}
public void setNumberOfGuesses(int numberOfGuesses) {
this.numberOfGuesses = numberOfGuesses;
}
public int getMaxGuesses() {
return maxGuesses;
}
public void setMaxGuesses(int maxGuesses) {
this.maxGuesses = maxGuesses;
}
public List<String> getGuesses() {
return guesses;
}
public void setGuesses(List<String> guesses) {
this.guesses = guesses;
}
public String getCurrentWord() {
return currentWord;
}
public void setCurrentWord(String currentWord) {
this.currentWord = currentWord;
}
}