I have to create a table with two type BitSet dimensions (9x9). I fulfills this table with bit values 1 to 9. I wish to withdraw a value of a particular case (exemple 5), but .set method (int, boolean) modifies all the boxes in my chart.
how to do ??
//create
private BitSet[][] solveur = new BitSet[9][9];
//init
BitSet BitInitialisation = new BitSet();
BitInitialisation.set(1, 10);
for (int ligne = 0; ligne < 9; ligne++) {
for (int colonne = 0; colonne < 9; colonne++) {
solveur[ligne][colonne] = BitInitialisation;
}
}
//read + method call
for (int ligne = 0; ligne < 9; ligne++) {
for (int colonne = 0; colonne < 9; colonne++) {
AjusterLigne(ligne ,5);
}
}
//method "AjusterLigne"
private void AjusterLigne(int ligne, int valeur) {
for (int colonne = 0; colonne < GrilleSudoku.MAX; colonne++){
solveur[ligne][colonne].set(valeur, false);
}
}
result: empty table...