résolution de problèmes de synchro
This commit is contained in:
@@ -1 +1 @@
|
||||
Appuyez sur une touche pour continuer...
|
||||
Press any key to continue . . .
|
||||
|
||||
@@ -15,8 +15,8 @@ BUT : Fichier de fonctions Tic Tac Toe
|
||||
using namespace std;
|
||||
|
||||
extern const int LARGTIC;
|
||||
string iconJ1 = "X";
|
||||
string iconJ2 = "O";
|
||||
string ICONJ1 = "X";
|
||||
string ICONJ2 = "O";
|
||||
string style = "themes/themeSea.txt";
|
||||
int codeConsole = 0;
|
||||
|
||||
@@ -90,15 +90,15 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) {
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
string emoteUp,
|
||||
emoteDown,
|
||||
emoteJ1,
|
||||
emoteJ2;
|
||||
iconJ1,
|
||||
iconJ2;
|
||||
|
||||
// Faire une fonction pour retenir le th<74>me s<>lectionn<6E> par le joueur!!!!
|
||||
|
||||
ouvrirFichier(monFlux, style);
|
||||
if (monFlux) {
|
||||
while (!monFlux.eof()) {
|
||||
monFlux >> emoteUp >> emoteDown >> emoteJ1 >> emoteJ2;
|
||||
monFlux >> emoteUp >> emoteDown >> ICONJ1 >> ICONJ2;
|
||||
}
|
||||
monFlux.close();
|
||||
cout << endl;
|
||||
@@ -132,7 +132,6 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
cout << " ";
|
||||
}
|
||||
cout << " ";
|
||||
}
|
||||
cout << "|" << endl << " " << k + 1 << " ";
|
||||
|
||||
@@ -157,7 +156,6 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
cout << " ";
|
||||
}
|
||||
cout << " ";
|
||||
}
|
||||
cout << "|" << endl << " ";
|
||||
|
||||
@@ -200,23 +198,20 @@ void tourJoueur(string grid[][LARGTIC], int joueur) {
|
||||
verticale -= 1;
|
||||
horizontale -= 1;
|
||||
|
||||
while (grid[verticale][horizontale] == iconJ1 || grid[verticale][horizontale] == iconJ2) {
|
||||
while (grid[verticale][horizontale] == ICONJ1 || grid[verticale][horizontale] == ICONJ2) {
|
||||
// V<>RIFIER LE CIN D'ERREUR!!!!!
|
||||
cout << "\n\nVeuillez choisir une case vide.\n"
|
||||
<< "\n\nEntrez une coordonnee verticale : ";
|
||||
cin >> verticale;
|
||||
cout << "\nEntrez une coordonnee horizontale : ";
|
||||
cin >> horizontale;
|
||||
|
||||
verticale--;
|
||||
horizontale--;
|
||||
}
|
||||
|
||||
if (joueur == 1) {
|
||||
grid[verticale][horizontale] = iconJ1;
|
||||
grid[verticale][horizontale] = ICONJ1;
|
||||
}
|
||||
else {
|
||||
grid[verticale][horizontale] = iconJ2;
|
||||
grid[verticale][horizontale] = ICONJ2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,7 +326,7 @@ void tourOrdi(string grid[][LARGTIC]) {
|
||||
vertical = rand() % (3);
|
||||
horizontal = rand() % (3);
|
||||
} while (grid[vertical][horizontal] != "");
|
||||
grid[vertical][horizontal] = iconJ2;
|
||||
grid[vertical][horizontal] = ICONJ2;
|
||||
afficherImageTableau(grid, style);
|
||||
}
|
||||
|
||||
@@ -357,7 +352,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) {
|
||||
}
|
||||
|
||||
//Changer le th<74>me
|
||||
void changerLeTheme(bool &theme) {
|
||||
void changerLeTheme() {
|
||||
string grid[LARGTIC][LARGTIC];
|
||||
system("cls");
|
||||
do {
|
||||
@@ -369,9 +364,6 @@ void changerLeTheme(bool &theme) {
|
||||
choix = toupper(_getche());
|
||||
cout << endl;
|
||||
|
||||
if (choix >= 'A' && choix <= 'D') {
|
||||
theme = true;
|
||||
}
|
||||
switch (choix) {
|
||||
case 'A':
|
||||
style = "themes/themeSea.txt";
|
||||
|
||||
@@ -35,5 +35,5 @@ void tourOrdi(std::string grid[][LARGTIC]);
|
||||
void jeuDeuxJoueurs(std::string grid[][LARGTIC]);
|
||||
|
||||
//Changer le th<74>me
|
||||
void changerLeTheme(bool& theme);
|
||||
void changerLeTheme();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user