correction des modèles

This commit is contained in:
2025-10-08 12:02:44 +02:00
parent 0dbd7751e1
commit e5f9fd7fa8
2 changed files with 12 additions and 19 deletions

View File

@@ -1,3 +1,5 @@
package fr.iutfbleau.TD3_DEV51_Qualite_Algo.Models;
public class Letter{
private char letter;
private boolean status = false;
@@ -6,11 +8,11 @@ public class Letter{
this.letter = letter;
}
/* Show status */
private boolean getStatus(){
return status
public boolean getStatus(){
return status;
}
/* Verify status true, false */
private boolean isGood(char c){
public boolean isGood(char c){
if( this.letter == c){
this.status = true;
return true;

View File

@@ -1,20 +1,22 @@
package fr.iutfbleau.TD3_DEV51_Qualite_Algo.Models;
import java.util.*;
public class Word {
private String word;
private final String word;
private Letter[] tabLetter;
private String c;
private Word(String word){
this.word = word;
for(int i = 0; i< this.word.length();i++){
this.tabLetter[i] = Letter(this.word.charAt(i))
this.tabLetter[i] = new Letter(this.word.charAt(i));
}
}
/* Lettre dans le mot */
private boolean VerifyLetter(String c){
private boolean VerifyLetter(char c){
boolean return_bool = false;
for(Letter letter in this.tabLetter){
for(Letter letter : this.tabLetter){
if(!letter.getStatus()){
if(letter.isGood(c)){
return_bool = true;
@@ -26,7 +28,7 @@ public class Word {
/* Le mot a été deviné */
private boolean IsComplet(){
if(Letter letter : this.tabLetter){
for(Letter letter : this.tabLetter){
if(!letter.getStatus()){
return false;
}
@@ -35,15 +37,4 @@ public class Word {
return true;
}
}