Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Tout les droit reserve MouhcineFD
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- void pausesc(int nbresec)
- {
- clock_t goal;
- goal=(nbresec*CLOCKS_PER_SEC)+clock();
- while(goal>clock())
- ;
- }
- void attefc(int nbrp)
- {
- int i;
- for(i=nbrp; i>0; i--)
- {
- printf("%d\n",i);
- pausesc(1);
- }
- system("cls");
- }
- void initialise(char *tab,char *tabb)
- {
- int i;
- for(i=0; i<6; i++)
- tabb[i]=' ';
- tabb[6]='\0';
- tab[0]=2;
- tab[1]=14;
- tab[2]=6;
- tab[3]=11;
- tab[4]=4;
- tab[5]=234;
- tab[6]=15;
- tab[7]=3;
- tab[8]=12;
- tab[9]=5;
- tab[10]=1;
- tab[11]=232;
- tab[12]='\0';
- }
- int main()
- {
- system("title TestMemoire By MouhcineFD");
- printf("////////////////////////////////////////////////////////////\n");
- printf("////////////////////////////////////////////////////////////\n");
- printf("//// Bienvenue Sur TestMemoire Devlopper Par MouhcineFD ////\n");
- printf("////////////////////// To Startimes ////////////////////////\n");
- printf("////////////////////////////////////////////////////////////\n");
- printf("////////////////////////////////////////////////////////////\n\n");
- pausesc(3);
- int i,a=0,nbrh,j,score=0,vrj=0;
- char tab[13],tabb[7],tabc[13];
- srand(time(NULL));
- initialise(&tab,&tabb);
- printf("TEST N 1\nRappelez-vous bien ces symboles !!!\n\n");
- for(i=0; i<6; i++)
- {
- do
- {
- nbrh=(rand()%(11-0+1))+0;
- for(j=0; j<6; j++)
- if(tab[nbrh]==tabb[j])
- nbrh=100;
- }
- while(nbrh==100);
- tabb[i]=tab[nbrh];
- printf(" %c\n",tabb[i]);
- }
- printf("\n");
- attefc(10);
- printf("\n");
- for(i=0; i<12; i++)
- printf(" %d : %c \n",i,tab[i]);
- printf("\nEntrez les numeros des symboles que t'ai vu :\n");
- for(i=0; i<6; i++)
- {
- scanf("%d",&nbrh);
- for(j=0; j<6; j++)
- {
- if(tab[nbrh]==tabb[j])
- {
- printf("Vrai\n");
- score+=25;
- vrj=1;
- a++;
- }
- }
- if(vrj!=1)
- {
- printf("Faute\n");
- score-=25;
- }
- vrj=0;
- }
- printf("\nVous avez %d bonnes reponses sur 6.\n\n",a);
- system("pause");
- a=0;
- initialise(&tab,&tabb);
- system("cls");
- printf("\nTEST N 2\nSouviens tres bien de l'ordre de ces symboles !!!\n\n");
- for(i=0; i<6; i++)
- {
- do
- {
- nbrh=(rand()%(6-1+1))+1;
- for(j=0; j<6; j++)
- if(tabb[j]==nbrh)
- nbrh=100;
- }
- while(nbrh==100);
- tabb[i]=nbrh;
- printf(" %d => %c\n",i+1,tabb[i]);
- }
- printf("\n");
- attefc(15);
- printf("\n");
- for(i=1; i<=6; i++)
- printf(" %d : %c\n",i,i);
- printf("\nInserez l'ordre de symbole.\n\n");
- for(i=0; i<6; i++)
- {
- printf(" %d => ",i+1);
- scanf("%d",&nbrh);
- if(tabb[i]==nbrh)
- {
- printf("Vrai\n");
- score+=50;
- a++;
- }
- else
- {
- printf("Faute\n");
- score-=25;
- }
- }
- printf("\nVous avez %d bonnes reponses sur 6.\n\n",a);
- system("pause");
- a=0;
- initialise(&tab,&tabb);
- system("cls");
- printf("\nTEST N 3\nRappelez-vous bien le total de ces symboles !!!\n\n");
- for(i=0; i<12; i++)
- tabc[i]=tab[(rand()%(11-0+1))+0];
- tabc[12]='\0';
- for(i=0; i<12; i+=3)
- printf(" %c + %c = %c\n",tabc[i],tabc[i+1],tabc[i+2]);
- printf("\n");
- attefc(20);
- printf("\n");
- for(i=0; i<12; i++)
- printf(" %d : %c\n",i,tab[i]);
- for(j=0; j<4; j++)
- {
- do
- {
- do
- {
- nbrh=(rand()%(9-0+1))+0;
- }
- while(nbrh!=0&&nbrh!=3&&nbrh!=6&&nbrh!=9);
- }
- while(nbrh==tabb[0]||nbrh==tabb[1]||nbrh==tabb[2]||nbrh==tabb[3]);
- tabb[j]=nbrh;
- }
- printf("\n");
- printf("\nInserez le total de ces deux symboles :\n\n");
- for(j=0; j<4; j++)
- {
- printf(" %c + %c = ",tabc[tabb[j]],tabc[tabb[j]+1]);
- scanf("%d",&vrj);
- if(tab[vrj]==tabc[tabb[j]+2])
- {
- printf("Vrai\n");
- score+=100;
- a++;
- }
- else
- {
- printf("Faute\n");
- score-=25;
- }
- }
- printf("\nVous avez %d bonnes reponses sur 4.\n\n",a);
- system("pause");
- system("cls");
- printf("Votre score est : %d\n",score);
- system("pause");
- system("cls");
- printf("////////////////////////////////////////\n");
- printf("////////////// MouhcineFD //////////////\n");
- printf("//// vous remercions d'avoir choisi ////\n");
- printf("////////////// TestMemoire /////////////\n");
- printf("////////////////////////////////////////\n");
- pausesc(3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment