This commit is contained in:
Emmanuel Srivastava
2025-03-17 17:11:48 +01:00
6 changed files with 56 additions and 11 deletions

View File

@@ -0,0 +1,11 @@
import java.util.Arrays;
public class Duplication {
public static void main(String[] args) {
double[] tableau = new double[10];
Arrays.fill(tableau, 5.8);
System.out.println(Arrays.toString(tableau));
}
}

View File

@@ -0,0 +1,27 @@
public class Configuration {
private char[9] grille;
/*
On veut que chaque case soit un x ou un o et que si elle est vide alors n
la première case est 1 la deuxième 2, etc...
*/
public Configuration() {
this.grille = {'n','n','n','n','n','n','n','n','n'};
}
public static int estLibre(int posGrille) {
if(this.grille[posGrille-1] == 'n') {
return true;
}
}
public void jouer(int position, char joueur) {
if(joueur == 'x') {
this.grille[position-1] = 'x';
} else if(joueur == 'o') {
this.grille[position-1] = 'o';
}
}
}

View File

@@ -3,14 +3,10 @@ import java.awt.*;
public class Declinaisons extends JComponent {
private Color cyan = Color.CYAN;
private Color pink = Color.PINK;
private Color magenta = Color.MAGENTA;
private Color yellow = Color.YELLOW;
private Color blue = Color.BLUE;
public Declinaisons() {
super();
public Declinaisons(String form, String fond) {
if(inst % 2 == 0) {
secondPinceau.setColor("")
}
}
@Override
@@ -21,10 +17,19 @@ public class Declinaisons extends JComponent {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.setColor(this.getForeground());
for(int i=0; i<10; i++){
if(this.num % 2 == 0){
this.num ++;
secondPinceau.setColor(Color.MAGENTA);
} else {
secondPinceau.setColor(Color.CYAN);
}
}
int[] Xpoints = {this.getWidth()/4, this.getWidth()/4*3, this.getWidth()/2};
int[] Ypoints = {this.getHeight()/2, this.getHeight()/4, this.getHeight()/4*3};
secondPinceau.fillPolygon(Xpoints, Ypoints, 3);

View File

@@ -9,8 +9,10 @@ public class Main {
GridLayout tabl = new GridLayout(2,2);
fenetre.setLayout(tabl);
for(int i = 0; i < 4; i++)
for(int i = 0; i < 4; i++){
fenetre.add(new Declinaisons());
}
}
}

Binary file not shown.