From aaa2aee13154b436ba6ee2efdb71d713e0483de4 Mon Sep 17 00:00:00 2001 From: Qv1ko Date: Mon, 3 Apr 2023 21:15:30 +0200 Subject: [PATCH] Reto #13 - Java --- .../java/Qv1ko.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Retos/Reto #13 - ADIVINA LA PALABRA [Media]/java/Qv1ko.java b/Retos/Reto #13 - ADIVINA LA PALABRA [Media]/java/Qv1ko.java index 4361231d37..466eec537d 100644 --- a/Retos/Reto #13 - ADIVINA LA PALABRA [Media]/java/Qv1ko.java +++ b/Retos/Reto #13 - ADIVINA LA PALABRA [Media]/java/Qv1ko.java @@ -16,9 +16,11 @@ private static void guessTheWord(String keyWord) { System.out.println("The word is \""+misteryWord+"\""); System.out.print("Attempt ("+(i+1)+"/"+keyWord.length()+"): "); attemp=sc.nextLine(); - if(attemp.equalsIgnoreCase(keyWord)) { - guessed=true; - break; + if(attemp.length()==keyWord.length()) { + if(attemp.equalsIgnoreCase(keyWord)) { + guessed=true; + break; + } } else if(attemp.length()==1) { for(int j=0;j