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