diff --git a/fonctions affichage heure b/fonctions affichage heure new file mode 100644 index 0000000..7743ad8 --- /dev/null +++ b/fonctions affichage heure @@ -0,0 +1,268 @@ +void afficherTableauH1(int* tableau2) +{//------------------------------------------------------------------------------------void + + FILE* HEURE1= NULL; + HEURE1=ouverture(dizaines_h); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) {//--------------------------------while + c= fgetc(HEURE1); + if (c == '\n') + {//------------------------------------------------if + cpt++; }//----------------------------------------------if + }//-------------------------------------------------while + + + do {//-------------------------------------------------------------------do/while + c= fgetc(HEURE1); + if(c == '0' || c == '1') {//--------------------if + tableau2[i++] = c; + + }//---------------------------------------------if + }while(c != EOF);//------------------------------------------------------do/while + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) {//------------------------------------------------------for + for(j = 0; j < 3; j++){ //------------for + + if (tableau2[i*24+j]=='0'){ + printf(" "); + } + else { + printf("%c",987); + } + }//------------------------------------------------------------------------------for + printf("\n"); + + }//------------------------------------------------------------------for +}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main + + +void afficherTableauH2(int* tableau2) +{//------------------------------------------------------------------------------------void + + FILE* HEURE2= NULL; + HEURE2=ouverture(unites_h); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) {//--------------------------------while + c= fgetc(HEURE2); + if (c == '\n') + {//------------------------------------------------if + cpt++; }//----------------------------------------------if + }//-------------------------------------------------while + + + do {//-------------------------------------------------------------------do/while + c= fgetc(HEURE2); + if(c == '0' || c == '1') {//--------------------if + tableau2[i++] = c; + + }//---------------------------------------------if + }while(c != EOF);//------------------------------------------------------do/while + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) {//------------------------------------------------------for + for(j = 4; j < 7; j++){ //------------for + + if (tableau2[i*24+j]=='0'){ + printf(" "); + } + else { + printf("%c",987); + } + }//------------------------------------------------------------------------------for + printf("\n"); + + }//------------------------------------------------------------------for +}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main + + + +void afficherTableauM1(int* tableau2) +{//------------------------------------------------------------------------------------void + + FILE* MIN1= NULL; + MIN1=ouverture(dizaines_m); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) {//--------------------------------while + c= fgetc(MIN1); + if (c == '\n') + {//------------------------------------------------if + cpt++; }//----------------------------------------------if + }//-------------------------------------------------while + + + do {//-------------------------------------------------------------------do/while + c= fgetc(MIN1); + if(c == '0' || c == '1') {//--------------------if + tableau2[i++] = c; + + }//---------------------------------------------if + }while(c != EOF);//------------------------------------------------------do/while + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) {//------------------------------------------------------for + for(j = 10; j < 13; j++){ //------------for + + if (tableau2[i*24+j]=='0'){ + printf(" "); + } + else { + printf("%c",987); + } + }//------------------------------------------------------------------------------for + printf("\n"); + + }//------------------------------------------------------------------for +}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main + + +void afficherTableauM2(int* tableau2) +{//------------------------------------------------------------------------------------void + + FILE* MIN2= NULL; + MIN2=ouverture(unites_m); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) {//--------------------------------while + c= fgetc(MIN2); + if (c == '\n') + {//------------------------------------------------if + cpt++; }//----------------------------------------------if + }//-------------------------------------------------while + + + do {//-------------------------------------------------------------------do/while + c= fgetc(MIN2); + if(c == '0' || c == '1') {//--------------------if + tableau2[i++] = c; + + }//---------------------------------------------if + }while(c != EOF);//------------------------------------------------------do/while + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) {//------------------------------------------------------for + for(j = 13; j < 16; j++){ //------------for + + if (tableau2[i*24+j]=='0'){ + printf(" "); + } + else { + printf("%c",987); + } + }//------------------------------------------------------------------------------for + printf("\n"); + + }//------------------------------------------------------------------for +}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main + + + + + + + +void afficherTableauS1(int* tableau2) +{//------------------------------------------------------------------------------------void + + FILE* SEC1= NULL; + SEC1=ouverture(dizaines_s); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) {//--------------------------------while + c= fgetc(SEC1); + if (c == '\n') + {//------------------------------------------------if + cpt++; }//----------------------------------------------if + }//-------------------------------------------------while + + + do {//-------------------------------------------------------------------do/while + c= fgetc(SEC1); + if(c == '0' || c == '1') {//--------------------if + tableau2[i++] = c; + + }//---------------------------------------------if + }while(c != EOF);//------------------------------------------------------do/while + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) {//------------------------------------------------------for + for(j = 19; j < 22; j++){ //------------for + + if (tableau2[i*24+j]=='0'){ + printf(" "); + } + else { + printf("%c",987); + } + }//------------------------------------------------------------------------------for + printf("\n"); + + }//------------------------------------------------------------------for +}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main + + + + + + +void afficherTableauS2(int* tableau2) +{//------------------------------------------------------------------------------------void + + FILE* SEC2= NULL; + SEC2=ouverture(unites_s); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) + {//--------------------------------while + c= fgetc(SEC2); + if (c == '\n') + {//------------------------------------------------if + cpt++; + }//----------------------------------------------if + }//-------------------------------------------------while + + + do {//-------------------------------------------------------------------do/while + c= fgetc(SEC2); + if(c == '0' || c == '1') {//--------------------if + tableau2[i++] = c; + + }//---------------------------------------------if + }while(c != EOF);//------------------------------------------------------do/while + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) {//------------------------------------------------------for + for(j = 22; j < 26; j++){ //------------for + + if (tableau2[i*24+j]=='0'){ + printf(" "); + } + else { + printf("%c",987); + } + }//------------------------------------------------------------------------------for + printf("\n"); + + }//------------------------------------------------------------------for +}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main