wamdeus
Messages postés46Date d'inscriptionmercredi 2 janvier 2008StatutMembreDernière intervention 4 décembre 2008
-
11 mai 2008 à 14:40
wamdeus
Messages postés46Date d'inscriptionmercredi 2 janvier 2008StatutMembreDernière intervention 4 décembre 2008
-
11 mai 2008 à 14:44
bon bah c'est très simple mon but est de créer un mot mêlés, j'ai donc
fait des méthodes d'alignement comme ci dessous :
//
public void Diag6_1(String word){
int j=1;
for (int i=0;i<6;i++){
while(grille.getMatrice()[i][j]==' ' | grille.getMatrice()[i][j]==word.charAt(i)){
grille.getMatrice()[i][j]=word.charAt(i);
j++;
}}
}
puis j'appelle ma fonction comme ceci
//
public class lancement {
static protected Mots mots;
static protected alignement ali;
public static void main(String[] args) {
ali = new alignement();
ali.Diag6_1("calcul");
for (int i=0;i<8;i++){
for (int j=0;j<8;j++){
System.out.print(ali.grille.getValue(i,j)+" ");
}
System.out.println("");
System.out.println("");
}}}
lorsque je la lance; j'ai une superbe erreur qui est :
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at Camoufles.alignement.Diag6_1(alignement.java:1649)
at Camoufles.lancement.main(lancement.java:12)
comment faire pour d'un enlever cette erreur
deux que mon code marche ..? ??
Merci d'avance