correction algo notation (encore)

This commit is contained in:
Haïssous Kayyissa 2023-04-09 17:20:06 +02:00
parent e44c528a73
commit e87e252360
2 changed files with 7 additions and 3 deletions

View File

@ -154,12 +154,13 @@ public class GameActivity extends Activity implements SaisieActivity {
textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
textView.setGravity(Gravity.CENTER); textView.setGravity(Gravity.CENTER);
if (gagne){ if (gagne){
textView.setText("Victoire de l'attaquand en test coups"); textView.setText("Victoire de l'attaquant en "+this.grille.getSizeSubs()+" coups");
} else { } else {
textView.setText("Victoire du défenseur"); textView.setText("Victoire du défenseur");
} }
this.rootView.addView(textView); this.rootView.addView(textView);
System.out.println(textView.getText()); System.out.println(textView.getText());
this.rootView.invalidate();
} }
//initialise les collections de pions et remplie saisie et grille de pions vides //initialise les collections de pions et remplie saisie et grille de pions vides

View File

@ -43,8 +43,10 @@ public class Bot {
for(int i=0; i<4;i++) { for(int i=0; i<4;i++) {
if (copyCombi[i]==soumission[i]) { if (copyCombi[i]==soumission[i]) {
note.add(this.pionsNotation[1]); note.add(this.pionsNotation[1]);
System.out.println(copyCombi[i]+" good "+i);
copyCombi[i]=null; copyCombi[i]=null;
System.out.println(note.getLast()+" good "+i); soumission[i]=null;
System.out.println(copyCombi[i]+" good "+i);
} }
} }
@ -54,8 +56,9 @@ public class Bot {
for (int y=0;y<4;y++){ for (int y=0;y<4;y++){
if (soumission[y]==copyCombi[i]) { if (soumission[y]==copyCombi[i]) {
note.add(this.pionsNotation[0]); note.add(this.pionsNotation[0]);
System.out.println(note.getLast() + " almost "+i); System.out.println(copyCombi[i] + " almost "+i+" "+y);
copyCombi[i] = null; copyCombi[i] = null;
System.out.println(copyCombi[i] + " almost "+i+" "+y);
} }
} }
} }