maybe the last commit of first screen

This commit is contained in:
pierre-geeraert
2016-12-12 21:37:51 +01:00
committed by GitHub
parent acf9a25dff
commit f29a3beae0
+14 -23
View File
@@ -13,23 +13,16 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
system("gcc -o heure-vrai heure-vrai.c;./heure-vrai"); system("gcc -o heure-vrai heure-vrai.c;./heure-vrai");//utilisation de heure-vrai.c pour afficher l'heure dasn l historique
/*clear the screen , open picture and history , write type of lock screen in history */ /*clear the screen , open picture and history , write type of lock screen in history */
system("clear"); //system("clear");
FILE* fichier = NULL; FILE* fichier = NULL;//declare fichier et history comme des pointeurs de FILE
FILE* history = NULL; FILE* history = NULL;
history = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/history.txt", "a"); history = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/history.txt", "a");
fprintf(history," statique "); fprintf(history," statique ");//ecriture dans l historique du type d affichage
@@ -46,23 +39,23 @@ system("gcc -o heure-vrai heure-vrai.c;./heure-vrai");
/*switch qui permet d'ouvrir une image en fonction d'un nombre aleatoire entre 1 et 5 */ /*switch qui permet d'ouvrir une image en fonction d'un nombre aleatoire entre 1 et 5 */
switch(nbrAlea) switch(nbrAlea)
{case 1: {case 1:
fichier = fopen("image1", "r"); fichier = fopen("image1-2", "r");
fprintf(history," je suis en pause"); fprintf(history," je suis en pause");
break; break;
case 2: case 2:
fichier = fopen("image2", "r"); fichier = fopen("image2-2", "r");
fprintf(history," tetris"); fprintf(history," tetris");
break; break;
case 3: case 3:
fichier = fopen("image3", "r"); fichier = fopen("image3-2", "r");
fprintf(history," start to continue"); fprintf(history," start to continue");
break; break;
case 4: case 4:
fichier = fopen("image4", "r"); fichier = fopen("image4-2", "r");
fprintf(history," psychédélique"); fprintf(history," psychédélique");
break; break;
case 5: case 5:
fichier = fopen("image5", "r"); fichier = fopen("image5-2", "r");
fprintf(history," jul"); fprintf(history," jul");
break; break;
default: default:
@@ -82,9 +75,7 @@ break;
caractereactuel = fgetc(fichier); // on lit le caractere caractereactuel = fgetc(fichier); // on lit le caractere
// printf("%c", caractereactuel); // on l'affiche
//printf("%d",compt);
switch(caractereactuel) switch(caractereactuel)
{ {
@@ -96,9 +87,9 @@ break;
printf("%c",240); printf("%c",240);
break; break;
case '\t': //tab case '\t': //tab
//printf("er"); //vide pour empecher que \t soit considerer comme default
break; break;
//case
default: default:
printf("\n "); printf("\n ");
linecounter++; linecounter++;
@@ -108,15 +99,15 @@ break;
} while (linecounter < 30 ); // on continue tant que compteurglobal n'a pas finis le fichier } while (linecounter < 28 ); // on continue tant que compteurglobal n'a pas finis le fichier
fclose(fichier); fclose(fichier);//fermeture des fichiers
fclose(history); fclose(history);
} }
//attente de l appui d une touche
system("stty cbreak -echo"); system("stty cbreak -echo");
getchar(); getchar();
system("stty cooked -echo"); system("stty cooked -echo");