From 30faa26274104e33296c501b67c50312ba2f9b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Sat, 20 Nov 2021 10:59:16 +0100 Subject: [PATCH] master --- .vscode/launch.json | 3 ++- .vscode/tasks.json | 19 +++++++++++++++++++ bin/various_tests/Input.class | Bin 1655 -> 1808 bytes bin/various_tests/random.class | Bin 896 -> 742 bytes src/lab6/WordManager.java | 2 +- src/various_tests/Input.java | 12 +++++++++++- src/various_tests/random.java | 29 +++++++---------------------- 7 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 560a0cf..4b4c274 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -373,7 +373,8 @@ "name": "Launch random", "request": "launch", "mainClass": "various_tests.random", - "projectName": "Labo_6a2f7ad1" + "projectName": "Labo_6a2f7ad1", + "encoding":"UTF-8" } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..51a86b2 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "java", + "targetPath": "${workspaceFolder}/${workspaceFolderBasename}.jar", + "elements": [ + "${compileOutput}", + "${dependencies}" + ], + "problemMatcher": [], + "label": "java: exportjar:Labo", + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/bin/various_tests/Input.class b/bin/various_tests/Input.class index a3aa29ea6e6e8d6b6ace5d6858b488409af94244..9885a96378da3fe7c69136d438f6b278003b19c9 100644 GIT binary patch literal 1808 zcmbW1+j7%Z6o&up9Fz!=1cO7)kaDsE#2ib(6iS>JTnvFY7{U#s*gHYsNEulU@J`Hd zxJWu>rVr4ED*d;#7$xnE=(-;%95pc9)?fKuBaj;wMldRna9qXK zAw#YoM#JEXo)U(XKfY zNlYsVe-gNq?pS&M;7rBD5KgM_Q=H~rc+_t$x<6wfjX{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M6Ek<7<$onjbVgpjyhJm zO_!lrFa(L{8be{lfyZV-`JS@-}pkABBkg;R6N9@WIj-9Oy$p6v(&zH6X`d>&B(i+wj(QFZAnz&YnDP52n aucAP4lyPt=A(Tfc84@+AXkOQBu<;9@_e<>n delta 558 zcmYLEy-wR;6g}5=?AQdFkU}6KiA&Sgraz%DupoqFbtqLOL{NtemA=rZ(57jWMwL3z zpTHvj@Pfb($O-!Uu4`ikB@0DC z`iuIhsx8(2T&?~3(QAH7p$xZw<(jjoSa=+Ml&Os;cq&MCo9a`rt+;{i`GEt0m%=1+ z4(9N}!gE137Tft=UGMI+d$k@rsP_`D1Xd@4T5W;h1^$QdpOnLEsfZD}+MJl-JFUF? zmy!mroz_?Kdocg#QW%7pK`8!bQHMi6izNLBG^Ai+6gD2vr}@V55Lx6f!78{}EJ!@V zKT5Nn;g~4PGSm2S7-Nr)-3h`;=r^#%G%3m3NVSNr#Y7Iw7Y<0(Y#3# zqrK9YVvMqJX2NZN1T=e9s5_1PP^D4Z_i(P{KOJAr>hP>U~hV#OlwE5#S3 P1`ViUo*cpJn7MEVk=IIl diff --git a/src/lab6/WordManager.java b/src/lab6/WordManager.java index 1fb546a..5345451 100644 --- a/src/lab6/WordManager.java +++ b/src/lab6/WordManager.java @@ -7,7 +7,7 @@ public class WordManager { void askSecretWord(){ //System.out.print("Enter your secret word: "); - //String s = Input.readString(); + //secretWord = Input.readString(); secretWord = Dialogs.getHiddenString("Enter your secret word: "); secretWord = stripAccents(secretWord); secretWord = secretWord.toLowerCase(); diff --git a/src/various_tests/Input.java b/src/various_tests/Input.java index e98b08c..e6ff6ce 100644 --- a/src/various_tests/Input.java +++ b/src/various_tests/Input.java @@ -1,5 +1,9 @@ package various_tests; import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.spi.CharsetProvider; +import java.util.Scanner; /** * The Class Input is here to enter data with the keyboard.
@@ -20,9 +24,15 @@ public class Input */ public static String readString() { - BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); + // VERSION PROF + BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_16)); try {return stdin.readLine(); } catch (Exception ex) { return "";} + + /* // VERSION PERSO + Scanner scanner = new Scanner(System.in); + return scanner.nextLine(); + */ } /** diff --git a/src/various_tests/random.java b/src/various_tests/random.java index 03bcd26..a51e8ae 100644 --- a/src/various_tests/random.java +++ b/src/various_tests/random.java @@ -1,32 +1,17 @@ package various_tests; - // import hevs.utils.Input; public class random { - - - public static int nbr(boolean a, boolean b, boolean c) { - int nbr = 0; - if (a) { - nbr+=1; - } - if (b) { - nbr+=1; - } - if (c) { - nbr+=1; - } - return nbr; - } - - public static char alpha(char a, char b) { - return a