Add Models Algo #6

Open
Abed BRIDJA wants to merge 3 commits from bridja/TD3_DEV51_Bridja_Creuzet_Hochlaf:2erbranche into master
6 changed files with 107 additions and 0 deletions

9
.idea/TD3_DEV51_Qualite_Algo.iml generated Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
TD3_DEV51_Qualite_Algo/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

14
TD3_DEV51_Qualite_Algo/.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -0,0 +1,7 @@
package fr.iutfbleau.TD3_DEV51_Qualite_Algo;
public class Main {
public static void main(String[] args) {
}
}

View File

@@ -0,0 +1,20 @@
public class Letter{
private char letter;
private boolean status = false;
public Letter(char letter){
this.letter = letter;
}
/* Show status */
private boolean getStatus(){
return status
}
/* Verify status true, false */
private boolean isGood(char c){
if( this.letter == c){
this.status = true;
return true;
}
return false;
}
}

View File

@@ -0,0 +1,49 @@
import java.util.*;
public class Word {
private 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))
}
}
/* Lettre dans le mot */
private boolean VerifyLetter(String c){
boolean return_bool = false;
for(Letter letter in this.tabLetter){
if(!letter.getStatus()){
if(letter.isGood(c)){
return_bool = true;
}
}
}
return return_bool;
}
/* Le mot a été deviné */
private boolean IsComplet(){
if(Letter letter : this.tabLetter){
if(!letter.getStatus()){
return false;
}
}
return true;
}
}