Files
TicTacToe/TicTacToe/main.cpp
2025-11-28 08:56:28 -05:00

63 lines
1.4 KiB
C++

/*====================================
AUTEURS : Léa Dezothez et Solène Baillargeon
PROJET : Final
NOM DU FICHIER : main.cpp
DATE : 2025-11-14
BUT : Main pour le jeu Tic Tac Toe
====================================*/
#include <iostream>
#include "fonctions.h"
using namespace std;
const string ICONJ1 = "X";
const string ICONJ2 = "O";
int main() {
srand(time(NULL));
bool theme = false;
char choix;
string grid[LARGTIC][LARGTIC];
do {
initGrid(grid);
afficherMenu(choix);
switch (choix) {
case 'A':
if (theme == true) {
system("cls");
jeuUnJoueur(grid);
}
else {
cout << "\n\nVeuillez choisir un theme d'abord.";
}
break;
case 'B':
if (theme == true) {
system("cls");
jeuDeuxJoueurs(grid);
}
else {
cout << "\n\nVeuillez choisir un theme d'abord.";
}
break;
case 'C':
changerLeTheme(theme);
theme = true;
break;
case 'Q':
cout << "\nAu revoir!";
break;
default:
cout << endl << "Saisissez un choix valide." << endl;
break;
}
system("PAUSE>nul");
} while (choix != 'Q');
}