Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #include "fonction.h"
- #include "dico.h"
- #include <time.h>
- #define MOT_MYSTERE "PERSONNE"
- #define TAILLE_MAX 50
- #define NOMBRE_ESSAI 10
- /*
- fonction.h ---- http://pastebin.com/SnSRKpjb
- fonction.c ---- http://pastebin.com/54w07xp9
- dico.h ---- http://pastebin.com/qWkYuueE
- dico.c ---- http://pastebin.com/0ZVtvV7x
- Dictionnaire des mots : http://pastebin.com/jjVMaAQJ
- */
- int main()
- {
- srand(time(NULL));
- depart:
- printf("Bienvenue dans le Pendu !\n\n");
- char motMystere[TAILLE_MAX] = "", afficherPendu[TAILLE_MAX] = "",afficherFaute[20] = "";
- Dictionnaire(motMystere);
- CopierLeMotMystere(motMystere,afficherPendu);
- int test = 0,essaiRestant = NOMBRE_ESSAI;
- do
- {
- if(essaiRestant <= 0)
- {
- printf("\n\n\nVous avez epuise votre nombre d'essai");
- printf("\nLe mot mystere etait : %s\n\n\n",motMystere);
- Pause();
- goto fin;
- }
- else
- {
- printf("\nVous avez essaye les lettres : %s\nIl vous reste %d essai\n",afficherFaute,essaiRestant);
- AfficherPendu(essaiRestant);
- printf("\nMot secret : %s",afficherPendu);
- printf("\nVotre proposition : ");
- TestCaractere(motMystere,afficherPendu,&essaiRestant,&test,afficherFaute);
- }
- }while(test == 0);
- printf("\n\nBravo tu a trouve le mot mystere : %s\n\n",motMystere);
- Pause();
- goto fin;
- return 0;
- fin:
- printf("\a\nVoulez vous recommencer ? (o/n)\n");
- char retry = lireCaractere();
- if(retry == 'O')
- goto depart;
- else
- exit(0);
- }
Add Comment
Please, Sign In to add comment