Merge branch 'main' of https://gitea.zkd.ca/DEV_WEB/TicTacToe
This commit is contained in:
@@ -15,8 +15,8 @@ BUT : Fichier de fonctions Tic Tac Toe
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
extern const int LARGTIC;
|
extern const int LARGTIC;
|
||||||
const string ICONJ1 = { "X" };
|
string ICONJ1 = { "X" };
|
||||||
const string ICONJ2 = { "O" };
|
string ICONJ2 = { "O" };
|
||||||
int codeConsole = 0;
|
int codeConsole = 0;
|
||||||
|
|
||||||
fstream monFlux;
|
fstream monFlux;
|
||||||
@@ -93,15 +93,16 @@ void initTab(string grid[][LARGTIC]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void afficherImageTableau(std::string grid[][LARGTIC]) {
|
void afficherImageTableau(std::string grid[][LARGTIC], std::string style) {
|
||||||
SetConsoleOutputCP(CP_UTF8);
|
SetConsoleOutputCP(CP_UTF8);
|
||||||
string emoteUp,
|
string emoteUp,
|
||||||
emoteDown;
|
emoteDown;
|
||||||
|
|
||||||
// Faire une fonction pour retenir le th<74>me s<>lectionn<6E> par le joueur!!!!
|
// Faire une fonction pour retenir le th<74>me s<>lectionn<6E> par le joueur!!!!
|
||||||
ouvrirFichier(monFlux, "themes/themeGrass.txt");
|
ouvrirFichier(monFlux, style);
|
||||||
if (monFlux) {
|
if (monFlux) {
|
||||||
while (!monFlux.eof()) {
|
while (!monFlux.eof()) {
|
||||||
monFlux >> emoteUp >> emoteDown;
|
monFlux >> emoteUp >> emoteDown >> ICONJ1 >> ICONJ2;
|
||||||
}
|
}
|
||||||
monFlux.close();
|
monFlux.close();
|
||||||
cout << endl;
|
cout << endl;
|
||||||
@@ -330,22 +331,42 @@ void historiqueDesScores() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Changer le th<74>me
|
//Changer le th<74>me
|
||||||
void changerLeTheme() {
|
void changerLeTheme(std::string &style) {
|
||||||
|
string grid[LARGTIC][LARGTIC] = {ICONJ1, ICONJ2};
|
||||||
system("cls");
|
system("cls");
|
||||||
cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl
|
cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl
|
||||||
<< "Options des styles: " << "\nA) Ocean"
|
<< "Options des styles: " << "\nA) Ocean"
|
||||||
<< "\nB) Fantaisie" << "\nC) Espace"
|
<< "\nB) Fantaisie" << "\nC) Espace"
|
||||||
<< "\nD) Animaux" << "\nChoisir une option: ";
|
<< "\nD) Animaux" << "\nQ) Revenir en arriere"
|
||||||
|
<< "\nChoisir une option: ";
|
||||||
choix = toupper(_getche());
|
choix = toupper(_getche());
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
switch (choix) {
|
switch (choix) {
|
||||||
case 'A': {
|
case 'A':
|
||||||
|
style = "themes/themeSea.txt";
|
||||||
|
afficherImageTableau(grid, style);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 'B': {
|
case 'B':
|
||||||
|
style = "themes/themeFantasy.txt";
|
||||||
|
afficherImageTableau(grid, style);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 'C':
|
||||||
|
style = "themes/themeEspace.txt";
|
||||||
|
afficherImageTableau(grid, style);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'D':
|
||||||
|
style = "themes/themeAnimaux.txt";
|
||||||
|
afficherImageTableau(grid, style);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Q':
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
cout << "\nChoisir une option valide. \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user