Téléverser les fichiers vers "/"
This commit is contained in:
parent
8feb400da4
commit
38c5caa165
44
main.c
Normal file
44
main.c
Normal file
@ -0,0 +1,44 @@
|
||||
#include <stdlib.h>
|
||||
#include <graph.h> // Bibliothèque graphique
|
||||
#include "graphics_utils.h"
|
||||
#include "blocus.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void play_single_player(Game* game);
|
||||
void play_two_players(Game* game);
|
||||
|
||||
int main() {
|
||||
int grid_size = 0;
|
||||
int mode = 0; // 1 : Un joueur, 2 : Deux joueurs
|
||||
|
||||
while (1) {
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(100, 100, 800, 600);
|
||||
|
||||
// Écran 1 : Choix de la taille de la grille et du mode
|
||||
grid_size = choose_grid_size(&mode);
|
||||
|
||||
// Écran 2 : Lancement de la partie
|
||||
Game game;
|
||||
initialize_game(&game, grid_size);
|
||||
|
||||
if (mode == 1) {
|
||||
play_single_player(&game);
|
||||
} else {
|
||||
play_two_players(&game);
|
||||
}
|
||||
|
||||
// Écran 3 : Résultat
|
||||
display_winner(game.winner);
|
||||
|
||||
FermerGraphique();
|
||||
|
||||
// Recommencer ?
|
||||
printf("Recommencer ? (1: Oui, 0: Non)\n");
|
||||
int replay;
|
||||
scanf("%d", &replay);
|
||||
if (!replay) break;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue
Block a user