diff --git a/DEV1.1/TP13/epilepsie.c b/DEV1.1/TP13/epilepsie.c new file mode 100644 index 0000000..fa67df6 --- /dev/null +++ b/DEV1.1/TP13/epilepsie.c @@ -0,0 +1,28 @@ +#include +#include +#include + + +int main(int argc, char const *argv[]) +{ + FILE *f; + f=fopen("image.bin","r"); + int x; + int y; + couleur c; + fread(&x,sizeof(int),1,f); + fread(&y,sizeof(int),1,f); + InitialiserGraphique(); + CreerFenetre(10,10,x,y); + for(int i=0;i +#include +#include + + +int main(int argc, char const *argv[]) +{ + FILE *f; + f=fopen("image.bin","r"); + int x; + int y; + couleur c; + fread(&x,sizeof(int),1,f); + fread(&y,sizeof(int),1,f); + InitialiserGraphique(); + CreerFenetre(10,10,x,y); + fseek(f,(sizeof(unsigned long int)*768*(1024/2)),SEEK_SET); + for(int i=1024/2;i +#include +#include +#include +#include + + +int main(int argc, char const *argv[]) +{ + int min; + int heure; + printf("rentrez une heure (format: hh mm):\n"); + scanf("%d %d",&heure,&min); + InitialiserGraphique(); + CreerFenetre(10,10,130,38); + time_t t = time(NULL); + struct tm tm = *localtime(&t); + char tab[8]; + couleur c=CouleurParNom("white"); + while(5!=0) + { + EffacerEcran(c); + t = time(NULL); + tm = *localtime(&t); + sprintf(tab,"%02d:%02d:%02d",heure-tm.tm_hour,min-tm.tm_min,60-tm.tm_sec); + EcrireTexte(10,30,tab,2); + sleep(1); + } +}