This commit is contained in:
2021-11-19 16:14:57 +01:00
parent 76eda5920f
commit c2997d7363
3 changed files with 401 additions and 21 deletions

View File

@ -77,6 +77,28 @@ 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;
hang.updateGraphicsView();
while (hang.play() && !hang.word.isWordComplete()) {
System.out.println(hang.word.userWord);
}
// System.out.print ("Do you want play another party ? (y/n) ");
// char answer = Input.readChar();
char answer = Dialogs.getChar("Do you want play another party ? (y/n) ");
if (answer != 'y' && answer != 'Y') {
// System.out.println("Ok, see you later.");
Dialogs.displayMessage("Ok, see you later.");
System.exit(1);
}
}
}
public String[] loadList(String filePath) {
String[] wordList;
@ -96,27 +118,6 @@ public class HangMan {
return null;
}
}
public static void main(String[] args) {
HangMan hang = new HangMan();
while (true) {
hang.word.askSecretWord();
hang.current_step = 0;
hang.updateGraphicsView();
while (hang.play() && !hang.word.isWordComplete()) {
System.out.println(hang.word.userWord);
}
// System.out.print ("Do you want play another party ? (y/n) ");
// char answer = Input.readChar();
char answer = Dialogs.getChar("Do you want play another party ? (y/n) ");
if (answer != 'y' && answer != 'Y') {
// System.out.println("Ok, see you later.");
Dialogs.displayMessage("Ok, see you later.");
System.exit(1);
}
}
}
}
// comentaire pour le fun