Grosse MàJ
This commit is contained in:
BIN
workspace/Puissance4/test/Principale.class
Normal file
BIN
workspace/Puissance4/test/Principale.class
Normal file
Binary file not shown.
51
workspace/Puissance4/test/Principale.java
Normal file
51
workspace/Puissance4/test/Principale.java
Normal file
@ -0,0 +1,51 @@
|
||||
package test;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Principale {
|
||||
|
||||
private Vector l1 = new Vector(6);
|
||||
private Vector l2 = new Vector(6);
|
||||
private Vector l3 = new Vector(6);
|
||||
private Vector l4 = new Vector(6);
|
||||
private Vector l5 = new Vector(6);
|
||||
private Vector l6 = new Vector(6);
|
||||
private Vector l7 = new Vector(6);
|
||||
|
||||
private void afficheJeu()
|
||||
{
|
||||
System.out.print(l7+"\n");
|
||||
System.out.print(l6+"\n");
|
||||
System.out.print(l5+"\n");
|
||||
System.out.print(l4+"\n");
|
||||
System.out.print(l3+"\n");
|
||||
System.out.print(l2+"\n");
|
||||
System.out.print(l1);
|
||||
}
|
||||
|
||||
private void initJeu()
|
||||
{
|
||||
for(int i=0; i<14; i++) //14 car caractere cod<6F> sur 2 octets
|
||||
{
|
||||
l1.add("1");
|
||||
l2.add("2");
|
||||
l3.add("3");
|
||||
l4.add("4");
|
||||
l5.add("5");
|
||||
l6.add("6");
|
||||
l7.add("7");
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
l1.set(3, "X");
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
Principale p4 = new Principale();
|
||||
|
||||
p4.initJeu();
|
||||
p4.afficheJeu();
|
||||
}
|
||||
}
|
||||
|
BIN
workspace/Puissance4/test/VadrouilleGrille.class
Normal file
BIN
workspace/Puissance4/test/VadrouilleGrille.class
Normal file
Binary file not shown.
70
workspace/Puissance4/test/VadrouilleGrille.java
Normal file
70
workspace/Puissance4/test/VadrouilleGrille.java
Normal file
@ -0,0 +1,70 @@
|
||||
package test;
|
||||
|
||||
/**
|
||||
* @author Olivier DOSSMANN
|
||||
*
|
||||
*/
|
||||
public class VadrouilleGrille {
|
||||
|
||||
private int[][] grille;
|
||||
private int[] positions;
|
||||
private int nbreColonnes = 7;
|
||||
private int nbreLignes = 6;
|
||||
|
||||
public static void main(String args[]){
|
||||
// Instructions de lancement
|
||||
|
||||
}
|
||||
|
||||
public void initialiser()
|
||||
{
|
||||
int nbr;
|
||||
// Cr<43>ation de la grille
|
||||
grille = new int[nbreColonnes][nbreLignes];
|
||||
|
||||
// Cr<43>ation tu tableau de positionnement
|
||||
positions = new int[7];
|
||||
|
||||
// Initialisation du tableau
|
||||
for (int i = 0; i < nbreColonnes; i++){
|
||||
for(int j = 0; j < nbreLignes; j++){
|
||||
nbr = (int)Math.random()*3;
|
||||
grille[i][j] = nbr;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation des positions
|
||||
for (int i = 0; i < nbreColonnes; i++){
|
||||
positions[i] = 0;
|
||||
}
|
||||
// // Test
|
||||
// grille[4][5] = j1.donneJeton();
|
||||
}
|
||||
|
||||
public void reinitialiser(){
|
||||
lancer();
|
||||
}
|
||||
|
||||
public void afficherGrille(){
|
||||
for (int i = nbreLignes - 1; i >= 0; i--){
|
||||
for(int j = 0; j < nbreColonnes; j++){
|
||||
System.out.print(grille[j][i] + "|");
|
||||
//System.out.print(j + "/" + i + "|");
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
System.out.println("--------------");
|
||||
System.out.println("1|2|3|4|5|6|7|");
|
||||
}
|
||||
|
||||
public void lancer(){
|
||||
System.out.println("Lancement du jeu de plateau");
|
||||
|
||||
// Initialisation du plateau
|
||||
this.initialiser();
|
||||
|
||||
// Affichage du plateau pour v<>rification
|
||||
this.afficherGrille();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user