Skip to content
Snippets Groups Projects
Commit 78309d00 authored by AMOCA OKKES's avatar AMOCA OKKES
Browse files

Debug

parents 75d2e53a cc9130c8
No related merge requests found
...@@ -4,7 +4,20 @@ ...@@ -4,7 +4,20 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="0242c1a9-e139-4946-98de-d110221679b6" name="Default Changelist" comment="" /> <list default="true" id="0242c1a9-e139-4946-98de-d110221679b6" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/kotlinc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/kotlinc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/KotlinJavaRuntime.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/KotlinJavaRuntime.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/puissance4_java.iml" beforeDir="false" afterPath="$PROJECT_DIR$/puissance4_java.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/dcc.mdj" beforeDir="false" afterPath="$PROJECT_DIR$/src/dcc.mdj" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/puissance4/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/puissance4/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/puissance4/model/Grille.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/puissance4/model/Grille.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
...@@ -33,13 +46,13 @@ ...@@ -33,13 +46,13 @@
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$USER_HOME$/IdeaProjects/P31_systeme_fichier" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="project.structure.last.edited" value="Modules" /> <property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" /> <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
</component> </component>
<component name="RunManager"> <component name="RunManager" selected="Application.Main">
<configuration name="FullRowDetection" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="FullRowDetection" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="puissance4.controleur.FullRowDetection" /> <option name="MAIN_CLASS_NAME" value="puissance4.controleur.FullRowDetection" />
<module name="puissance4_java" /> <module name="puissance4_java" />
...@@ -53,8 +66,35 @@ ...@@ -53,8 +66,35 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="puissance4.Main" />
<module name="puissance4_java" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="puissance4.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="ArquillianTestNG" factoryName="" nameIsGenerated="true">
<option name="arquillianRunConfiguration">
<value>
<option name="containerStateName" value="" />
</value>
</option>
<option name="TEST_OBJECT" value="CLASS" />
<properties />
<listeners />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Application.Main" />
<item itemvalue="Application.FullRowDetection" /> <item itemvalue="Application.FullRowDetection" />
</list> </list>
</recent_temporary> </recent_temporary>
...@@ -79,9 +119,7 @@ ...@@ -79,9 +119,7 @@
<workItem from="1607010556720" duration="2636000" /> <workItem from="1607010556720" duration="2636000" />
<workItem from="1607245589897" duration="24000" /> <workItem from="1607245589897" duration="24000" />
<workItem from="1607412315237" duration="91000" /> <workItem from="1607412315237" duration="91000" />
<workItem from="1607414232494" duration="651000" /> <workItem from="1607415898623" duration="2049000" />
<workItem from="1607414915432" duration="1277000" />
<workItem from="1607416619648" duration="2006000" />
</task> </task>
<servers /> <servers />
</component> </component>
......
No preview for this file type
No preview for this file type
package puissance4; package puissance4;
import puissance4.model.Grille;
import java.awt.*; import java.awt.*;
public class Main public class Main
{ {
public static void main(String[] args) public static void main(String[] args)
{ {
System.out.println("Hello World"); Grille grid = new Grille();
grid.displayGrille();
} }
} }
...@@ -113,8 +113,8 @@ public class FullRowDetection { ...@@ -113,8 +113,8 @@ public class FullRowDetection {
board[j][i] = tab[height-i-1][j] ; board[j][i] = tab[height-i-1][j] ;
System.out.println( Arrays.toString( System.out.println( Arrays.toString(
new FullRowDetection().detect( board ) new FullRowDetection().detect( board )
) ); ) );
} }
......
package puissance4.model; package puissance4.model;
import java.util.ArrayList;
import
public class Case { public class Case {
private int posLigne; private int posLigne;
private int posColonne; private int posColonne;
public Case(int posL, int posC) {
this.posLigne=posL;
this.posColonne=posC;
}
public boolean[][] getEnplacement(int posL, int posC){ public Case() {
return grille[posL][posC];
}
public void setEnplacement(int posL, int posC){
this.posLigne=posL;
this.posColonne=posC;
} }
public void Remplir(int posL, int posC){ private void Remplir(int posL, int posC){
for (int i = 0;i < grille.length; i++) {
for (int j = 0; j < grille[i].length; j++) {
grille[posL][posC] = true;
}
}
} }
} }
package puissance4.model; package puissance4.model;
import java.util.Arrays;
public class Grille public class Grille
{ {
private final int nbCases; private final int nbCases = 42;
private int nblignes; private final int nblignes = 6;
private int nbColonnes; private final int nbColonnes = 7;
public boolean[][] grille; private boolean[][] grid;
public Grille () public Grille() {
{ grid = new boolean[nblignes][nbColonnes];
this.nbCases = 42;
this.nblignes = 6;
this.nbColonnes = 7;
grille = new boolean[nblignes][nbColonnes];
} }
public int getNblignes() { public int getNblignes() {
return nblignes; return this.nblignes;
} }
public int getNbColonnes() { public int getNbColonnes() {
return nbColonnes; return this.nbColonnes;
} }
public void setNblignes(int nb) { public int getNbCases(){
this.nblignes = nb; return this.nbCases;
} }
public void setNbColonnes(int nb) { public boolean[][] getGrille(){
this.nbColonnes = nb; return this.grid;
} }
public boolean estVide() { public void displayGrille(){
return Arrays.toString(grille).isEmpty(); String res = "";
}
public boolean estPleine() { for (int i = 0; i < this.nblignes; i++) {
boolean res = false; for (int j = 0; j < this.nbColonnes; j++) {
for (int i = 0; i < grille.length; i++) { System.out.print(this.grid[i][j] + " ");
if (i == grille.length - 1) {
res = true;
} }
System.out.println();
} }
return res; System.out.println();
} }
} }
...@@ -2,13 +2,13 @@ package puissance4.model; ...@@ -2,13 +2,13 @@ package puissance4.model;
import java.awt.*; import java.awt.*;
public class Pion{ public class Pion {
private Color couleur; private Color couleur;
private Case emplacement; private Case emplacement;
public Pion(Color couleur) { public Pion(){
this.couleur=couleur;
} }
public Color getCouleur() { public Color getCouleur() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment