From 6bf323e0469011be38864f97ab16b9d14937594c Mon Sep 17 00:00:00 2001 From: thibault62 Date: Tue, 13 Dec 2016 12:57:34 +0100 Subject: [PATCH] add heure1.c to manipulate board --- heure1.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 heure1.c diff --git a/heure1.c b/heure1.c new file mode 100644 index 0000000..f963848 --- /dev/null +++ b/heure1.c @@ -0,0 +1,74 @@ +#include +#include + +void afficherTableau(int* tableau2); +int main(void) +{ + + + int* tableau2 = malloc(sizeof(int)*03*05); + FILE* fichier = fopen("0","r+"); + char c = 0; +int i=0; +int cpt = 0; + + while ( cpt < 2) { + c= fgetc(fichier); + if (c == '\n') + cpt++; + } + + + do { + c= fgetc(fichier); + if(c == '0' || c == '1') { + tableau2[i++] = c; + } + }while(c != EOF); + + afficherTableau(tableau2); + free(tableau2); + return EXIT_SUCCESS; /* Equivalent à return 0 sous Windows, permet un code portable */ +} + +void afficherTableau(int* tableau2) +{ + int i = 0; + int j = 0; + + for (i = 0; i < 5; i++) { + for(j = 0; j < 3; j++) { + printf("%c", tableau2[i*03+j]); +if (j==2){ +printf("\n"); + + do + + + { + + + + switch(caractereactuel) + { + case 49: //1 + printf("%c",987); + + break; + case 48: //0 + printf("%c",240); + + break; +system("clear") +} +} + + } + } + + + + +} + +