diff --git a/HangmanFx/src/application/Main.java b/HangmanFx/src/application/Main.java
index c445adf..2f5c6bb 100644
--- a/HangmanFx/src/application/Main.java
+++ b/HangmanFx/src/application/Main.java
@@ -102,27 +102,26 @@ public class Main extends Application {
}
// Check the letter from Textfield
- public boolean letterCheck(char[] wortToArr, char[] displayWord) {
-
- for (int i = 0; i < wort.length(); i++) {
- if (letter.getText().isEmpty() == false) {
- if (wortToArr[i] == letter.getText().toLowerCase().charAt(0)
+ public boolean arrayMatch(char[] wortToArr, char[] displayWord) {
+ boolean result = false;
+ if(!letter.getText().isEmpty()) {
+ for (int i = 0; i < wortToArr.length; i++) {
+ if(wortToArr[i] == letter.getText().toLowerCase().charAt(0)
|| wortToArr[i] == letter.getText().toUpperCase().charAt(0)) {
displayWord[i] = wortToArr[i];
- return true;
+ result = true;
+ }
}
- }
-
}
- return false;
+ return result;
}
// Confirm\check typed Letter
- public void checkLetter() {
+ public void verifyTypedLetter() {
info.setText("");
- if (letterCheck(wortToArr, displayWord) == true) {
+ if (arrayMatch(wortToArr, displayWord)) {
rightletterString = new String(displayWord);
hangmanWord.setText(rightletterString);
info.setText("Richtig");
diff --git a/HangmanFx/src/application/Ui.fxml b/HangmanFx/src/application/Ui.fxml
index 615b3e7..2fe147f 100644
--- a/HangmanFx/src/application/Ui.fxml
+++ b/HangmanFx/src/application/Ui.fxml
@@ -30,7 +30,7 @@
-
+