From ac3e725da73f43e9423a52de98e080aae6acb651 Mon Sep 17 00:00:00 2001 From: ericmp Date: Sat, 4 Sep 2021 10:16:56 +0200 Subject: [PATCH] sc: no line found exception solved --- .../la_brisca_cli_jar/la-brisca-cli.jar | Bin 41263 -> 41457 bytes src/com/labrisca/App.java | 10 +++--- src/com/labrisca/catalan/io/UserInput.java | 32 ++++++++++++------ src/com/labrisca/catalan/util/Color.java | 1 + src/com/labrisca/english/io/UserInput.java | 32 ++++++++++++------ src/com/labrisca/english/util/Color.java | 1 + 6 files changed, 48 insertions(+), 28 deletions(-) diff --git a/out/artifacts/la_brisca_cli_jar/la-brisca-cli.jar b/out/artifacts/la_brisca_cli_jar/la-brisca-cli.jar index 0b0c2f4a6c12d4d2fc74095e69e9dd23d2747c40..e41d855ef4c7ab01e215861252bff365fa4a7b45 100644 GIT binary patch delta 9111 zcma)hWmH_v(k=`T+!vb^0mDZ z{Y@d)^9|rufhY3@p)=ggGC?FroB;FL-oe<|h~VnT(yyEIOVLoUv%{{Gid1cqL_gV+ z>l;zm*;Z{nYW?d-Fn7PcGaN^c%<`MbdurBOu)PQ{_WanB>-a9r{%zV~Vg96+eZA>< ztevQo@CmXTkq#EO3W=ZT9Ek(j*A4#qY|gV#D9rcMMU-~s;zLc86c!7&H%+%?D5EiV^yBTC4?{Pn2<~bHV#by#@;V6qpXK~`-}97SUV`qs;A>MJvq#3 z-N#{p7xUx?3!P1rsH|_Rdt5RtS?|u8cz7?qG{KKb^J%%lHF)Vg z&`4cr5FZY_`+!^>5@kuh@FJw3`ZGD9i^&awxSPuKmbjL+%jT5eh=inUO=2q&`*vcb zf|~7zX^=2Si^nDc62T>70oAX2=8OSpTjdvTb-uqN;LDMiK(^%$4WM_JjbOG!TjbU# zajOp3>?j1UlVY+d;u}+{d*JR{sOl~;@dIm!_t2QiE}jbWDN^1LDZ1#yI?Aj^1Px_W zv>(B!X{jIt1SMpI-+d%x3NK_g@MWQH<}8G$v()nu-wu zdd6Oa3d9c!uL}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EG{1YBS_uE`A^LCn?^*>J*7FPqJ4$0l;{T(Pz&O*1|3?nRzj7`y z{|0tvpuv#Tp1A`v3|*DnqTzi08^Z`hgs^+l{=un(C6f76FD$&pf} zVL@3G|H{YBq0{<@(BmK=F#Icj;%@>>F-rik4fZ~Zm-_z?S_BN9C5_nrdnARiXA}RA z=zqhN12fMCBQE?NsbR`G=rE=XT-bUx84{ThOe2R17Hfp@*CmichR6m}&(TJzvitdAW32zbnsw3eSH7!vg&qSe#4s4>%4n ze_g+;&cr+b%^zI;Sz@^VH!cPL#Qv^Ov0z$xtVs7s|4D!T7hg<-fBNeGT4fmj!uM+m OY$A^w^(5tw_kRJ+!%_hN diff --git a/src/com/labrisca/App.java b/src/com/labrisca/App.java index cad2195..523d598 100644 --- a/src/com/labrisca/App.java +++ b/src/com/labrisca/App.java @@ -1,21 +1,19 @@ package com.labrisca; -import java.util.Scanner; +import com.labrisca.english.io.UserInput; public class App { public static void main(String[] args) { - Scanner sc = new Scanner(System.in); System.out.println("Choose language: Catalan or English"); while (true) { - System.out.print("> "); - String input = sc.nextLine().trim().toLowerCase(); + String input = UserInput.getInput(); // initialize and run game - if (input.equals("catalan")) { + if (input.equals("catalan") || input.equals("cat")) { System.out.println(); new com.labrisca.catalan.Game().run(); break; - } else if (input.equals("english")) { + } else if (input.equals("english") || input.equals("en")) { System.out.println(); new com.labrisca.english.Game().run(); break; diff --git a/src/com/labrisca/catalan/io/UserInput.java b/src/com/labrisca/catalan/io/UserInput.java index e10a7f9..c21a814 100644 --- a/src/com/labrisca/catalan/io/UserInput.java +++ b/src/com/labrisca/catalan/io/UserInput.java @@ -10,12 +10,27 @@ public class UserInput { UserInput() {} + // get user input + public static String getInput() { + String input = ""; + System.out.print("> " + Color.ANSI_CYAN); + + // check if program is forced to close + if (SC.hasNextLine()) { + input = SC.nextLine().trim().toLowerCase(); + System.out.print(Color.ANSI_RESET); + } else { + System.out.print(Color.ANSI_RESET); + System.exit(0); + } + return input; + } + // ask the game mode to the user public static String askGameMode() { System.out.println("[?] Activar el mode hacker?"); while (true) { - System.out.print("> "); - String input = SC.nextLine().trim().toLowerCase(); + String input = getInput(); if (input.equals("si") || input.equals("1")) { System.out.println("Mode hacker activat!"); System.out.print("Text" + Color.ANSI_PURPLE + " lila " + Color.ANSI_RESET); @@ -35,8 +50,7 @@ public static String askGameMode() { public static boolean askAIBot() { System.out.println("[?] Fer que el bot sigui intel·ligent?"); while (true) { - System.out.print("> "); - String input = SC.nextLine().trim().toLowerCase(); + String input = getInput(); if (input.equals("si") || input.equals("1")) { System.out.println("Perdràs :P!"); System.out.println(); @@ -54,8 +68,7 @@ public static boolean askAIBot() { public static boolean askPrintCardsInfo() { System.out.println("\n[?] Veure informació final de les cartes?"); while (true) { - System.out.print("> "); - String input = SC.nextLine().trim().toLowerCase(); + String input = getInput(); if (input.equals("si") || input.equals("1")) return true; else if (input.equals("no") || input.equals("0")) return false; System.out.println("Introdueix \"si\" o \"no\"..."); @@ -64,12 +77,9 @@ public static boolean askPrintCardsInfo() { // ask which card must be thrown or / and change latest card public static String askThrowCard(Player p) { - String input; while (true) { - System.out.print("> "); - input = SC.nextLine().trim(); - - // check if player wants and can change latest card + String input = getInput(); + // if player wants and can change latest card if (input.equals("7") && p.canChangeLastCard()) { p.changeLastCard(); p.printCardsInHand(); diff --git a/src/com/labrisca/catalan/util/Color.java b/src/com/labrisca/catalan/util/Color.java index 6c8f86e..69e87fe 100644 --- a/src/com/labrisca/catalan/util/Color.java +++ b/src/com/labrisca/catalan/util/Color.java @@ -12,6 +12,7 @@ public class Color { public static final String ANSI_YELLOW = "\u001B[33m"; public static final String ANSI_BLUE = "\u001B[34m"; public static final String ANSI_PURPLE = "\u001B[35m"; + public static final String ANSI_CYAN = "\u001B[36m"; Color() {} diff --git a/src/com/labrisca/english/io/UserInput.java b/src/com/labrisca/english/io/UserInput.java index 0ff31c2..7abce3d 100644 --- a/src/com/labrisca/english/io/UserInput.java +++ b/src/com/labrisca/english/io/UserInput.java @@ -10,12 +10,27 @@ public class UserInput { UserInput() {} + // get user input + public static String getInput() { + String input = ""; + System.out.print("> " + Color.ANSI_CYAN); + + // check if program is forced to close + if (SC.hasNextLine()) { + input = SC.nextLine().trim().toLowerCase(); + System.out.print(Color.ANSI_RESET); + } else { + System.out.print(Color.ANSI_RESET); + System.exit(0); + } + return input; + } + // ask the game mode to the user public static String askGameMode() { System.out.println("[?] Enable hacker mode?"); while (true) { - System.out.print("> "); - String input = SC.nextLine().trim().toLowerCase(); + String input = getInput(); if (input.equals("yes") || input.equals("1")) { System.out.println("Hacker mode on!"); System.out.print(Color.ANSI_PURPLE + "Purple " + Color.ANSI_RESET); @@ -35,8 +50,7 @@ public static String askGameMode() { public static boolean askAIBot() { System.out.println("[?] Enable bot's AI?"); while (true) { - System.out.print("> "); - String input = SC.nextLine().trim().toLowerCase(); + String input = getInput(); if (input.equals("yes") || input.equals("1")) { System.out.println("You'll lose :P!"); System.out.println(); @@ -54,8 +68,7 @@ public static boolean askAIBot() { public static boolean askPrintCardsInfo() { System.out.println("\n[?] See cards final information?"); while (true) { - System.out.print("> "); - String input = SC.nextLine().trim().toLowerCase(); + String input = getInput(); if (input.equals("yes") || input.equals("1")) return true; else if (input.equals("no") || input.equals("0")) return false; System.out.println("Input \"yes\" or \"no\"..."); @@ -64,12 +77,9 @@ public static boolean askPrintCardsInfo() { // ask which card must be thrown or / and change latest card public static String askThrowCard(Player p) { - String input; while (true) { - System.out.print("> "); - input = SC.nextLine().trim(); - - // check if player wants and can change latest card + String input = getInput(); + // if player wants and can change latest card if (input.equals("7") && p.canChangeLastCard()) { p.changeLastCard(); p.printCardsInHand(); diff --git a/src/com/labrisca/english/util/Color.java b/src/com/labrisca/english/util/Color.java index 300c030..d423c77 100644 --- a/src/com/labrisca/english/util/Color.java +++ b/src/com/labrisca/english/util/Color.java @@ -12,6 +12,7 @@ public class Color { public static final String ANSI_YELLOW = "\u001B[33m"; public static final String ANSI_BLUE = "\u001B[34m"; public static final String ANSI_PURPLE = "\u001B[35m"; + public static final String ANSI_CYAN = "\u001B[36m"; Color() {}