Correctif noms

This commit is contained in:
2025-10-08 16:14:39 +02:00
parent ffbe1e232e
commit e6e0d4cf71

View File

@@ -66,14 +66,14 @@ public class Partie {
this.remainingtry-- ; //Décrément des essais this.remainingtry-- ; //Décrément des essais
return true ; return true ;
}else{ }else{
boolean trouvé = false ; boolean isfind = false ;
for(byte i = 0 ; i < this.wordsize ; i++){ //Parcours du "secretword" for(byte i = 0 ; i < this.wordsize ; i++){ //Parcours du "secretword"
if(this.secretword[i] == letter){ if(this.secretword[i] == letter){
this.foundletters[i] = true ; this.foundletters[i] = true ;
trouvé = true ; isfind = true ;
} }
} }
if(trouvé == false){ if(isfind == false){
this.remainingtry-- ; //Décrément des essais this.remainingtry-- ; //Décrément des essais
} }
this.entriesletters[caractercode-CARACTERCODESHIFT] = true ; //Ajout au tableau des lettres jouées this.entriesletters[caractercode-CARACTERCODESHIFT] = true ; //Ajout au tableau des lettres jouées
@@ -106,23 +106,23 @@ public class Partie {
//Tests //Tests
public static void main(String[] args){ public static void main(String[] args){
char[] test = {'E','O','M','I','E','D','A','Z','N'}; char[] test = {'E','O','M','I','E','D','A','Z','N'};
byte taille = (byte) test.length ; byte size = (byte) test.length ;
boolean etat ; boolean status ;
Partie jeu = new Partie(); Partie game = new Partie();
System.out.println("Trick > " + String.valueOf(jeu.secretword) + "\n"); System.out.println("Trick > " + String.valueOf(game.secretword) + "\n");
for(byte i = 0 ; i < taille && !jeu.gameIsEnding() ; i++){ for(byte i = 0 ; i < size && !game.gameIsEnding() ; i++){
System.out.println("Essais restants : " + jeu.getRemainingTry()); System.out.println("Essais restants : " + game.getRemainingTry());
etat = jeu.isAlreadyEntries(test[i]); status = game.isAlreadyEntries(test[i]);
for(byte l = 0 ; l < jeu.wordsize ; l++){ //Parcours du "secretword" for(byte l = 0 ; l < game.wordsize ; l++){ //Parcours du "secretword"
if(jeu.foundletters[l] == true){ if(game.foundletters[l] == true){
System.out.print(jeu.getSecretWord()[l] + " "); System.out.print(game.getSecretWord()[l] + " ");
}else{ }else{
System.out.print("_ "); System.out.print("_ ");
} }
} }
System.out.println(""); //Lisibilité System.out.println(""); //Lisibilité
//System.out.println("Lettres : " + jeu.entriesletters); //System.out.println("Lettres : " + game.entriesletters);
} }
} }
} }