28 lines
769 B
C
28 lines
769 B
C
#include <graph.h>
|
|
|
|
#include "menu.h"
|
|
#include "comportementJCJ.h"
|
|
#include "comportementJCIA.h"
|
|
|
|
int Jeu(){
|
|
int choix[2], taille = 0, victoire = 0;
|
|
Menu(choix); /* Affiche le menu */
|
|
taille = choix[1];
|
|
if(choix[0] == 1){ /* Si l'utilisateur choisie Player VS Player */
|
|
victoire = compJCJ(taille);
|
|
if(victoire == 1){ /* Si le joueur 1 a gagner alors retourner 1 */
|
|
return 1;
|
|
}else if(victoire == 2){
|
|
return 2; /* Si le joueur 2 a gagner alors retourner 2 */
|
|
}
|
|
}else if (choix[0] == 2){ /* Si l'utilisateur choisie Player VS IA */
|
|
compJCIA(taille);
|
|
if(victoire == 1){
|
|
return 1; /* Si le joueur 1 a gagner alors retourner 1 */
|
|
}else if(victoire == 3){
|
|
return 3; /* Si l'IA a gagner alors retourner 3 */
|
|
}
|
|
}
|
|
return 0;
|
|
}
|