From 3c7a073220b2ac159e9e260c8c24317f7262bf99 Mon Sep 17 00:00:00 2001 From: blues Date: Mon, 3 Aug 2020 15:59:01 +0200 Subject: [PATCH] 03.08.2020 --- HangmanFx/src/application/Main.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/HangmanFx/src/application/Main.java b/HangmanFx/src/application/Main.java index d5d25ce..d0f852c 100644 --- a/HangmanFx/src/application/Main.java +++ b/HangmanFx/src/application/Main.java @@ -68,7 +68,7 @@ public class Main extends Application { private static final int COUNT_LIMIT = 10; - String wort; + private String wort; String rightletterString; char[] wortToArr; @@ -116,9 +116,12 @@ public class Main extends Application { public boolean letterCheck(char[] wortToArr, char[] displayWord) { for (int i = 0; i < wort.length(); i++) { - if (letter.getText().isEmpty() == false && wortToArr[i] == letter.getText().charAt(0)) { + if (letter.getText().isEmpty() == false) { + if(wortToArr[i] == letter.getText().toLowerCase().charAt(0) || wortToArr[i] == letter.getText().toUpperCase().charAt(0)) { displayWord[i] = wortToArr[i]; return true; + } + } } @@ -142,7 +145,7 @@ public class Main extends Application { if (counter == 16) { hangmanWord.setText(wort); - + } }