diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index 305f427..8179513 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -89,8 +89,8 @@ void afficherImageMenu(std::fstream& monFlux) { //Général (plusieurs options) void initGrid(string grid[][LARGTIC]) { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 3; j++) { + for (int i = 0; i < LARGTIC; i++) { + for (int j = 0; j < LARGTIC; j++) { grid[i][j] = ""; } } @@ -277,7 +277,7 @@ void tourJoueur(string grid[][LARGTIC], int joueur) { cout << "\n\nEntrez une coordonnee verticale : "; cin >> verticale; - while (verticale < 1 || verticale > 3) { + while (verticale < 1 || verticale > LARGTIC) { cout << "\n\nVeuillez entrer une donnee valide.\n" << "\n\nEntrez une coordonnee verticale : "; cin >> verticale; @@ -286,7 +286,7 @@ void tourJoueur(string grid[][LARGTIC], int joueur) { cout << "\nEntrez une coordonnee horizontale : "; cin >> horizontale; - while (horizontale < 1 || horizontale > 3) { + while (horizontale < 1 || horizontale > LARGTIC) { cout << "\n\nVeuillez entrer une donnee valide.\n" << "\n\nEntrez une coordonnee horizontale : "; cin >> horizontale; @@ -345,8 +345,8 @@ void tourOrdi(string grid[][LARGTIC]) { cout << "\n\nTour de l'ordinateur" << endl; do { - vertical = rand() % (3); - horizontal = rand() % (3); + vertical = rand() % (LARGTIC); + horizontal = rand() % (LARGTIC); } while (grid[vertical][horizontal] != ""); grid[vertical][horizontal] = iconJ2;