1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int a=0, b=0, c=0, get, total=0;
system("TITLE Le 421 by Trakiss");
system("COLOR 2F");
system("CLS");
printf("=== Jeu du 421 ===\n\n");
printf("Les regles:\n");
printf("Vous devez realiser avec les 3 des le nombre 421.\n\n");
printf("Pour lancer les des, appuyez sur une touche\n");
getch();
srand(time(NULL));
a = rand() % 7;
b = rand() % 7;
c = rand() % 7;
total = "a b c";
printf("\nDes lances.\n Votre score est %d", total);
if(total == 421)
printf("\n\nBravo vous avez gagnez !");
else
printf("\n\nDesole vous avez perdu");
printf("\n\nVoulez vous rejouer ? [o/n]");
get = getch();
if((get == 'o') || (get == 'O'))
{
printf(": Oui");
printf("\n\nrejouer");
}
getch();
return 0;
} |