From 1acb2bde6bf0629039b310e93282dc41442022eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Sat, 20 Nov 2021 15:04:48 +0100 Subject: [PATCH] master --- bin/lab6/HangMan.class | Bin 4461 -> 2564 bytes bin/lab6/WordManager.class | Bin 2144 -> 4189 bytes src/lab6/HangMan.java | 23 ----------------------- src/lab6/WordManager.java | 28 ++++++++++++++++++++++++++++ 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/bin/lab6/HangMan.class b/bin/lab6/HangMan.class index 9f4cbd10c97f584de02686ae9ff0a4f3ae99a8fc..985a4e485df1d796cf0bff7234cb10a091f8e9f8 100644 GIT binary patch delta 615 zcmZvZNo&(l6vclpLz5=|YLX_}VAR+;CrupD5+#*ZL=85YibSoDMUZNm)C|=)MQiIk z(f>k=U^hZ{LN&&qATC6~r3=9i;7;)ii1Eg5<-vt_&OP_tbKcL+3AgR@pEvJ-Z9JT_ z?K4?zEMZjRjP5kMD+NjxiVDZ6)L1HTxHQ&FYag~rle`a>7YkJKb^iL{W z1E+)jLOSg)=Su!es+i78bAcNgH@T%7S|WP6)u$h@_bHP;Wk2RMW1KH)QHUDctO62R!P)2C)lNF+UDCT(~a-0@j4rK`W)q% z#z&tcIn#LWnyAxjs&jp|QI*j~)=AxjCUro3ACy!MNh%3CI58-p9~M7@^pGUVQTB_^ wI75QOSuYa*{C?c#j@+y=;;#5s((B4G)1v2p9FV%RwS%b~l~yd0jVmQ=8ET;5>W1 z;%&0dUkHd~3_Gw>!Y@Zc7Jx6~K@hBnlQ;Ar(!(+y!J`CG&14AT@Nq5cS*NAlWaCwS zvd3jS;Ug3Aa~1s>cFTAY-ctg#P5`XH88aIzLkJ44Nd2J`^<;t+eOg8t{fwdJ^F~o% z$_V>x!A!flWhzTdcTx469EE2vAYq@t!~nQL=sgHL2F)39E5*EYn^fnUq$!fyoXXD+F<>J4XhYe6?S_GA<< zvYv)uIac}L9hC91&+JIrupBLhLwH5P?}o-3?8ZgcrM0}@zKq}dregwrrd&1MyTVq} z8mF8kfi6?swLJQvg9Y;t>dCU`3hw03NCqYaLaK3mIYttRO2N3*#Ti)zbragHv}&wW zZC&j#v=zm?w!%LM3?Fjqaavw@@>0)Zl&GQRdNS(Na~P1IonrM%H%IC{Qnl5xTyjRu zcWCZfE91oQF8(IrJ@ObZ(k5z4MV*)|eJY2&W@T z`B;qSZvwTGa2D#&jLB$0J7d!b+x z&c)+&*p2h?0>6F-F&FP3iNlzO&oLkWM5_q#rXP=mViGPEO;{{iFkM`LWu>Fh`Q8y0 zQ^QMX^#DXyKg{-~gjL41olSdiW*LR1nx|3MR7P?q;!ol_U%CgWGQLOIk2Yd-#q5TS zgC8bt-iz5^ua6hE4Zc(#@7gwaAaToHEC}z#Pj(LOVTKx34^}yv|I68air`$~vHO+$ z;&c*&D=~%Fio)jttimF!rr9^CQPGVRY#V5(l!`lWC*PvmUy6y z?Q{59lpDXzsD*wi}I zxYQK*))zprn9N`&WI{8a{^<{dL(pdmUL`ysMqP#1@H!!@BYbb*O{SeeN-m-{!dSI< z3vYW=ze9JKt`)OC(#%J325JUbQG_^3{E$l6An|L5af2jRs4Ar9P(0@ES_NTpm6s`< zBa@%Qj$J&2f=+7#p$G~OQCfpP2fDxDD}Uv|PyTlbKg3adf=?;&m-sUrBYW%q3v}DL A0{{R3 diff --git a/bin/lab6/WordManager.class b/bin/lab6/WordManager.class index dbd0a57e5d62bc772cef38157150c6bfc915cd93..b31d78b0c50d43a473e06188481602518cf6bf88 100644 GIT binary patch delta 2211 zcma)7`EwLi5dK~^n^}edmJI}!LsO|B3D+c)1dCOUBw!-p&;+OyMd4(2mJFGl*_xRR z1i?{MJn&vmP*gndHlS{V2;Pc-_kDo;=6@mfo1KuXRa*YAJMX>j{<^>ZdfuFmo~;y5 z{dMdFfQ2}JSZoY?wqho&^ajgLMv!I5G%b?XIhyUrwwBiAHKx{V>%E%XY^m9_X1b2t zWM#=(w_t9|^7ZX0&rP*5YI!#Gxwt!s>u_4B6gxq#17mfA%dG3$^&#lD0n1l*9*9X z41RFd)eU)>Z7Y4e7!kW6@#sAgZbywrb=s7!O*gd&?qpyI5!Ki$;cm_$>|_kxkGWUE zeduHeDaj-ce?Y>6SVtZ_x{sqiB;jE^!cgY8be3kAT2ot~?N?AZ>cKNqF4D zKEhBk8H2J_6$PZSrt0dJDYu&LieQ}>jVEwGz>^GXNPD#m)n)|D

*&j99elwsa3$2^IRu8`pI3zhLDMfWH zyHCQ`_=aJ0diaRp%*gjXh%A7&&`o7%PIa4Q^<*;%Dm*tnJjE;W;dHrW=;HYQ#sd0( z#|9nrdmbP+d5U4Q>#mjybvP)gUIh*5|_$ej!C zoj#V<<1m5tmts6-pd7Pkx165ssL1UpI}nef1XCbjDxFQkL`=t0+OI}s?kZu|_-eAw zpyIrW?VF3~`2SwW`qh|>m@?=y6&_cTs?lCLo=Fz($Hl}TM zzwc8{|6>uN{|3svki4((u__AwR7VBbMA~swdR_SUqkzh;^$_+`xr5lzIf$K|vj=eF z0KCPD(^vrP*w@3TA4uzs9T&teeyBh1WsKB4hB7- fIr@|J`NTyTfNDw@N`Y?VVqj!QWJqTybC3i89i|^l diff --git a/src/lab6/HangMan.java b/src/lab6/HangMan.java index fa59c07..2c23a11 100644 --- a/src/lab6/HangMan.java +++ b/src/lab6/HangMan.java @@ -1,9 +1,6 @@ package lab6; import hevs.graphics.FunGraphics; -import java.io.BufferedReader; -import java.io.FileReader; -import java.util.ArrayList; public class HangMan { final int MAX_STEPS = 8; @@ -80,7 +77,6 @@ public class HangMan { public static void main(String[] args) { HangMan hang = new HangMan(); - hang.loadList("C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S1fb/informatic/labo/vscode/Labo/src/lab6/french_common_words.csv"); while (true) { hang.word.askSecretWord(); hang.current_step = 0; @@ -99,25 +95,6 @@ public class HangMan { } } - - public String[] loadList(String filePath) { - String[] wordList; - try { - BufferedReader bf = new BufferedReader(new FileReader(filePath)); - ArrayList < String > al = new ArrayList < String > (); - while (bf.ready()) { - String[] c = bf.readLine().split(";"); - al.add(c[0]); - } - wordList = al.stream().toArray(String[]::new); - System.out.println("[Dictionary loaded with " + wordList.length + " words]"); - bf.close(); - return wordList; - } catch(Exception e) { - e.printStackTrace(); - return null; - } - } } // comentaire pour le fun diff --git a/src/lab6/WordManager.java b/src/lab6/WordManager.java index 5345451..5c5a55a 100644 --- a/src/lab6/WordManager.java +++ b/src/lab6/WordManager.java @@ -1,5 +1,8 @@ package lab6; import java.text.Normalizer; +import java.io.BufferedReader; +import java.io.FileReader; +import java.util.ArrayList; public class WordManager { private String secretWord = ""; @@ -46,4 +49,29 @@ public class WordManager { s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return s; } + + private String randomWord() { + loadList("C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S1fb/informatic/labo/vscode/Labo/src/lab6/french_common_words.csv"); + String s = ""; + return s; + } + + private String[] loadList(String filePath) { + String[] wordList; + try { + BufferedReader bf = new BufferedReader(new FileReader(filePath)); + ArrayList < String > al = new ArrayList < String > (); + while (bf.ready()) { + String[] c = bf.readLine().split(";"); + al.add(c[0]); + } + wordList = al.stream().toArray(String[]::new); + System.out.println("[Dictionary loaded with " + wordList.length + " words]"); + bf.close(); + return wordList; + } catch(Exception e) { + e.printStackTrace(); + return null; + } + } }