From 5022a7ded9260d565af1ccf846cb59337861a637 Mon Sep 17 00:00:00 2001 From: dullin <dullin@hololink.org> Date: Tue, 30 Mar 2021 07:45:24 -0400 Subject: [PATCH] Ajout de bugs --- .../tictactoejeu/presentateur/TicTacToePresentateur.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/hololink/tictactoejeu/presentateur/TicTacToePresentateur.java b/app/src/main/java/org/hololink/tictactoejeu/presentateur/TicTacToePresentateur.java index 22ba15a..c6e60f5 100644 --- a/app/src/main/java/org/hololink/tictactoejeu/presentateur/TicTacToePresentateur.java +++ b/app/src/main/java/org/hololink/tictactoejeu/presentateur/TicTacToePresentateur.java @@ -66,7 +66,7 @@ public class TicTacToePresentateur { for(row = 0; row < 3; ++row) { count = 0; - for(col=0; col < 3; ++col) + for(col=0; col <= 3; ++col) { count += (modele.getCellule(row,col).equals("X"))? 1 : (modele.getCellule(row,col).equals("O"))? -1 : 0; @@ -108,7 +108,7 @@ public class TicTacToePresentateur { count = 0; for(col = 0; col < 3; ++col) { - count += (modele.getCellule(col,2-col).equals("X"))? 1 : + count += (modele.getCellule(col,col).equals("X"))? 1 : (modele.getCellule(col,2-col).equals("O"))? -1 : 0; } if (count == 3 || count == -3) @@ -128,6 +128,7 @@ public class TicTacToePresentateur { case -1: return "O"; case 1: + modele.setNomJoueurX("bugbug"); return "X"; default: return ""; -- GitLab