This commit is contained in:
2021-11-20 10:59:16 +01:00
parent c2997d7363
commit 30faa26274
7 changed files with 40 additions and 25 deletions

View File

@ -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();

View File

@ -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.<br>
@ -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();
*/
}
/**

View File

@ -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<b?a:b;
}
public static void main(String[] args) {
System.out.println(alpha(Input.readChar(), Input.readChar()));;
String s = "héllo";
System.out.println(s);
s = "";
while (true) {
s = Input.readString();
System.out.println(s);
}
}
}