supprimé : 0

supprimé :        1
	supprimé :        2
	supprimé :        2points
	supprimé :        3
	supprimé :        4
	supprimé :        5
	supprimé :        6
	supprimé :        7
	supprimé :        8
	supprimé :        9
	supprimé :        Lecteur 5*3
	supprimé :        Tables 68*20
	supprimé :        dynamique/0
	supprimé :        dynamique/dynamique.c
	supprimé :        dynamique/exia.h
	supprimé :        dynamique/heure.c
	supprimé :        dynamique/heure2.c
	supprimé :        ecrit.c
	supprimé :        ex1.pbm
	supprimé :        exiasaver.c
	supprimé :        fonctions affichage heure
	supprimé :        fonctions centage
	supprimé :        heure
	supprimé :        heure-vrai.c
	supprimé :        heure.c
	supprimé :        heure1.c
	supprimé :        historic.c
	supprimé :        history.txt
	supprimé :        image1
	supprimé :        image2
	supprimé :        image3
	supprimé :        image4
	supprimé :        image5
	supprimé :        "lan\303\247eur.sh"
	supprimé :        launcher.c
	supprimé :        launcher2.c
	supprimé :        lecture.c
	supprimé :        menu stat
	supprimé :        pierre/jd
	supprimé :        statique/fonctions centage
	supprimé :        statique/lecture2.c

 Fichiers non suivis:
	final/
	vrac/
This commit is contained in:
pierre-geeraert
2016-12-16 22:27:26 +01:00
parent dfcba83495
commit 07d94b4b31
42 changed files with 0 additions and 2408 deletions
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 1
1 0 1
1 0 1
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
0 1 0
1 1 0
0 1 0
0 1 0
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
0 0 1
1 1 1
1 0 0
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
0 0 0
0 1 0
0 0 0
0 1 0
0 0 0
-8
View File
@@ -1,8 +0,0 @@
P1
3 5
1 1 1
0 0 1
0 1 1
0 0 1
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 0 1
1 0 1
1 1 1
0 0 1
0 0 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 0
1 1 1
0 0 1
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 0
1 1 1
1 0 1
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 1
0 0 1
0 0 1
0 0 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 1
1 1 1
1 0 1
1 1 1
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 1
1 1 1
0 0 1
1 1 1
-56
View File
@@ -1,56 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
void afficherTableau(int* tableau2);
int main(void)
{//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------main
int* tableau2 = malloc(sizeof(int)*03*05);
FILE* fichier = fopen("0","r+");
char c = 0;
int i=0;
int cpt = 0;
while ( cpt < 2) {//--------------------------------while
c= fgetc(fichier);
if (c == '\n')
{//------------------------------------------------if
cpt++; }//----------------------------------------------if
}//-------------------------------------------------while
do {//-------------------------------------------------------------------do/while
c= fgetc(fichier);
if(c == '0' || c == '1') {//--------------------if
tableau2[i++] = c;
}//---------------------------------------------if
}while(c != EOF);//------------------------------------------------------do/while
afficherTableau(tableau2);
free(tableau2);
return EXIT_SUCCESS; /* Equivalent à return 0 sous Windows, permet un code portable */
}
void afficherTableau(int* tableau2)
{//------------------------------------------------------------------------------------void
char c;
int i = 0;
int j = 0;
for (i = 0; i < 5; i++) {//------------------------------------------------------for
for(j = 0; j < 3; j++){ //------------for
if (tableau2[i*03+j]=='0'){
printf(" ");
}
else {
printf("%c",987);
}
}//------------------------------------------------------------------------------for
printf("\n");
}//------------------------------------------------------------------for
}//--------------------------------------------------------------------------------------------------------------------------------------------------------------main
-43
View File
@@ -1,43 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
void afficherTableau(int* tableau1);
int main(void)
{
int* tableau1 = malloc(sizeof(int)*68*20);
FILE* fichier = fopen("image1(2)","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') {
tableau1[i++] = c;
}
}while(c != EOF);
afficherTableau(tableau1);
free(tableau1);
return EXIT_SUCCESS; /* Equivalent à return 0 sous Windows, permet un code portable */
}
void afficherTableau(int* tableau1)
{
int i = 0;
int j = 0;
for (i = 0; i < 20; i++) {
for(j = 0; j < 68; j++) {
printf("Tableau1[%d][%d] = %c\n", i, j, tableau1[i*68+j]);
}
}
}
-7
View File
@@ -1,7 +0,0 @@
P1
3 5
1 1 1
1 0 1
1 0 1
1 0 1
1 1 1
-126
View File
@@ -1,126 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int main(void)
{
FILE* history = NULL;
history = fopen("/home/pierre/Documents/doc/history.txt", "a");//ouverture du fichier d historique permettant par la suite de noter le type de fond d ecran dans l historique
//fprintf(history,"date :");
system("echo $(date +%D) >> /home/pierre/Documents/doc/history.txt");
system("gcc -o heure /home/pierre/Documents/doc/heure.c;./heure");
fprintf(history," dynamique \n-----------\n");
fclose(history);
system("clear");
FILE* heure=NULL;
heure=fopen("heure","w");
srand(time(NULL));//element creant un nombre aleatoire pour la taille des caracteres meme si normalement ce sont les variables d'environements qui doivent gerer cette taille mais nous souhaitions changer cette regle pour permettre une modification de la taille des images quand meme
/*cette idée a été abandonné par la suite car nous souhaitions modifier la taille de l affichage de l heure dans un terminal Xterm or nous n avons pas reussi car nous manquions de temps */
int random=0;
random = (rand() % (0,3 ));
while (1)
{
time_t secondes;
struct tm instant;
time(&secondes);
instant=*localtime(&secondes);
int h=0;
int m=0;
int s=0;
int i=0;
int s1=0;
int m1=0;
int h1=0;
int j=0;
int k=0;
int l=0;
h=instant.tm_hour;
m=instant.tm_min;
s=instant.tm_sec;
/*switch (random)//cette commande permet de changer la taille du texte du terminal en ayant fais au prealable les modifications dans le fichier .Xconfig
{
case 0 :
{
break;
}
case 1 :
{
system("XTrem*faceSize:15");
break;
}
case 2 :
{
system("XTrem*faceSize:20");
break;
}
}*/
while (j<10)
{
printf("\n");
j++;
}
while (k<35)
{
printf(" ");
k++;
}
if (h<10)
{
printf("%d",h1);
fprintf(heure,"%d",h1);
}
printf("%d:",h);
fprintf(heure,"%d:",h);
if (m<10)
{
printf("%d",m1);
fprintf(heure,"%d",m1);
}
printf("%d:",m);
fprintf(heure,"%d:",m);
if (s<10)
{
printf("%d",s1);
fprintf(heure,"%d",s1);
}
printf("%d\n",s);
fprintf(heure,"%d\n",s);
//system("XTrem*faceSize:10");
while (l<10)
{
printf("\n");
l++;
}
while (m<15)
{
printf(" ");
m++;
}
printf("l'heure va s'actualiser dans quelques secondes");
while (i<10)
{
printf(".");
fflush(stdout);
sleep(1);
i++;
}
sleep(1);
system("clear");
}
return 0;
}
-328
View File
@@ -1,328 +0,0 @@
/*fonction qui permet l'ouverture des fichiers en fonction d un chiffre entre 0 et 9 qui correspond a une heure , dizaine d heure, minutes, dizaines minutes ...*/
FILE* ouverture(int temps) {//----ouverture
FILE* fichier=NULL;
switch(temps)
{
case 0:
fichier = fopen("0","r");
break;
case 1:
fichier = fopen("1","r");
break;
case 2:
fichier = fopen("2","r");
break;
case 3:
fichier = fopen("3","r");
break;
case 4:
fichier = fopen("4","r");
break;
case 5:
fichier = fopen("5","r");
break;
case 6:
fichier = fopen("6","r");
break;
case 7:
fichier = fopen("7","r");
break;
case 8:
fichier = fopen("8","r");
break;
case 9:
fichier = fopen("9","r");
break;
return fichier;
}}//------------------------ouverture
/*fonction qui permet de cnetrer une image dans u_n tableau */
int centre(void)
{
char v=0;
int tableau1[1920];
char b=0;
int L=0;
int C=0;
int col=0;
int lin=0;
int o=0;
while (v!='\0')
{
while (b!='\n')
{
b= fgetc(fichier);
C++;
}
// v= fgetc(fichier);//peut etre pas besoin
L++;
b=0;
}
col=(80-C)/2;
lin=(80-L)/2;
for (o=80*lin+col+1; o<=80*24-(80*lin+col+1); o++)
{
v=0;
v= fgetc(fichier);
tableau1[o]=v;
if (o%80==79-col)
{
o+=C+1;
}
}
return 0;
}
//----------------------------------------------------------------------
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
}//--------------------------------------------------------------------------------------------------------------------------------------------------------------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
}//--------------------------------------------------------------------------------------------------------------------------------------------------------------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
}//--------------------------------------------------------------------------------------------------------------------------------------------------------------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
}//--------------------------------------------------------------------------------------------------------------------------------------------------------------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
}//--------------------------------------------------------------------------------------------------------------------------------------------------------------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 = 0; j < 23; j++){ //------------for
if (tableau2[i*24+j]=='0')
{
printf(" ");
}
else {
printf("%c",987);
}
}//------------------------------------------------------------------------------for
printf("\n");
}//------------------------------------------------------------------for
}
void mettredstbl(void);
{
int ecrire;
FILE* tbl245=NULL;
tbl245=fopen("tableau245",w);
for (ecrire=0;ecrire=119; ecire++)
{
fprintf(tableau245,tableau2[ecrire]);
}
}
void lirefichier(void);
{
int r;
FILE* tbl245=NULL;
tbl245=fopen("tableau245",r);
r=fgetc(tbl245);
switch (r)
case 0:
{
printf(" ");
}
case 1:
{
printf("%c",987);
}
case '\n':
{
int bordure;
for (bordure=0; bordure=55; bordure++)
{
printf(" ");
}
}
case '\0':
{
break;
}
}
-85
View File
@@ -1,85 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//#include </media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/dynamique/exia.h>//permet la fonction ouverture
#include </home/projet-tvp/Images/projet2/exia.h>
/*initialiser la fct afficherTableau avec comme argument tableau2 qui correspond au tableau qui va etre centré*/
void afficherTableauH1(int* tableau2);
void afficherTableauH2(int* tableau2);
void afficherTableauM1(int* tableau2);
void afficherTableauM2(int* tableau2);
void afficherTableauS1(int* tableau2);
void afficherTableauS2(int* tableau2);
void lirefichier(void);
void mettredstbl(void);
FILE* ouverture(int temps);
int main()
{
int* tableau2 = malloc(sizeof(int)*24*5);//creation d un tableau statique de 24*5 avce allocation de memoire
int h=0;
int m=0;
int s=0;
FILE* fichier_h=NULL;/*differents fichiers qui permettent d'ouvrir les fichiers pbm des dizaines d heure , heures , dizaines de minutes ...*/
FILE* fichier_h2=NULL;
FILE* fichier_m=NULL;
FILE* fichier_m2=NULL;
FILE* fichier_s=NULL;
FILE* fichier_s2=NULL;
while(1)
{
time_t secondes;
struct tm instant;
time(&secondes);
instant=*localtime(&secondes);
h=instant.tm_hour;/*recupere l heure dans les variables h m et s*/
m=instant.tm_min;
s=instant.tm_sec;
int dizaines_h = h/10;
int unites_h = h%10;
int dizaines_m = m/10;
int unites_m = m%10;
int dizaines_s = s/10;
int unites_s = s%10;
printf("%d %d\n",dizaines_h,unites_h);/*extrait */
printf("%d %d\n",dizaines_m,unites_m);
printf("%d %d\n",dizaines_s,unites_s);
/*fichier_h equivaut a un fichier qui stocke une image pbm , il correspond a la dizeaine d'heure ,idem pour les autres fonctions*/
fichier_h=ouverture(dizaines_h);
fichier_h2=ouverture(unites_h);
fichier_m=ouverture(dizaines_m);
fichier_m2=ouverture(unites_m);
fichier_s=ouverture(dizaines_s);
fichier_s2=ouverture(unites_s);
/*utilisation des fonctions afficherTableau*/
afficherTableauH1(tableau2);
afficherTableauH2(tableau2);
afficherTableauM1(tableau2);
afficherTableauM2(tableau2);
afficherTableauS1(tableau2);
afficherTableauS2(tableau2);
mettredstbl();
lirefichier();
system("sleep 3");
system ("clear");
}
fclose(tbl245);
free(tableau2);
return 0;
}
-75
View File
@@ -1,75 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include </media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/dynamique/exia.h>//permet la fonction ouverture
/*initialiser la fct afficherTableau avec comme argument tableau2 qui correspond au tableau qui va etre centré*/
void afficherTableauH1(int* tableau2);
void afficherTableauH2(int* tableau2);
void afficherTableauM1(int* tableau2);
void afficherTableauM2(int* tableau2);
void afficherTableauS1(int* tableau2);
void afficherTableauS2(int* tableau2);
FILE* ouverture(int temps);
int main()
{
int* tableau2 = malloc(sizeof(int)*24*5);//creation d un tableau statique de 24*5 avce allocation de memoire
int h=0;
int m=0;
int s=0;
FILE* fichier_h=NULL;/*differents fichiers qui permettent d'ouvrir les fichiers pbm des dizaines d heure , heures , dizaines de minutes ...*/
FILE* fichier_h2=NULL;
FILE* fichier_m=NULL;
FILE* fichier_m2=NULL;
FILE* fichier_s=NULL;
FILE* fichier_s2=NULL;
while(1)
{
time_t secondes;
struct tm instant;
time(&secondes);
instant=*localtime(&secondes);
h=instant.tm_hour;/*recupere l heure dans les variables h m et s*/
m=instant.tm_min;
s=instant.tm_sec;
int dizaines_h = h/10;
int unites_h = h%10;
int dizaines_m = m/10;
int unites_m = m%10;
int dizaines_s = s/10;
int unites_s = s%10;
printf("%d %d\n",dizaines_h,unites_h);/*extrait */
printf("%d %d\n",dizaines_m,unites_m);
printf("%d %d\n",dizaines_s,unites_s);
/*fichier_h equivaut a un fichier qui stocke une image pbm , il correspond a la dizeaine d'heure ,idem pour les autres fonctions*/
fichier_h=ouverture(dizaines_h);
fichier_h2=ouverture(unites_h);
fichier_m=ouverture(dizaines_m);
fichier_m2=ouverture(unites_m);
fichier_s=ouverture(dizaines_s);
fichier_s2=ouverture(unites_s);
/*utilisation des fonctions afficherTableau*/
afficherTableauH1(tableau2);
afficherTableauH2(tableau2);
afficherTableauM1(tableau2);
afficherTableauM2(tableau2);
afficherTableauS1(tableau2);
afficherTableauS2(tableau2);
system("sleep 3");
system ("clear");
}
free(tableau2);
return 0;
}
-10
View File
@@ -1,10 +0,0 @@
/*but et d ecrire a la suite le type d affichage*/
#include <stdio.h>
#include <time.h>
int main(void)
{FILE* fichier = NULL;
fichier = fopen("test.txt", "a");
fprintf(fichier,"a");
fclose(fichier);
}
-8
View File
@@ -1,8 +0,0 @@
P1
# Un exemple de fichier pbm
5 5
0 1 1 1 1
0 1 0 1 1
0 0 0 1 0
1 1 0 1 0
0 1 1 0 0
-82
View File
@@ -1,82 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
void afficherTableau(int* tableau1);
int main(void)
{
int* tableau1 = malloc(sizeof(int)*80*24);
FILE* fichier = fopen("image1(2)","r+");//changer nom ----------------------------------------------------
char c = 0;
char v=0;
char b=0;
int L=0;
int C=0;
int col=0;
int lin=0;
int o=0;
while (v!='\0')
{
while (b!='\n')
{
b= fgetc(fichier);
C++;
}
v= fgetc(fichier);
L++;
b=0;
}
col=(80-C)/2;
lin=(80-L)/2;
for (o=80*lin+col+1, o=80*24-(80*lin+col+1), o=o+80)
{
if (o==78-col%80)
{
o=o+C+1;
}
}
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')
{
tableau1[i++] = c;
}
}while(c != EOF);
afficherTableau(tableau1);
free(tableau1);
return EXIT_SUCCESS; // Equivalent à return 0 sous Windows, permet un code portable
}
void afficherTableau(int* tableau1)
{
int i = 0;
int j = 0;
for (i = 0; i < 24; i++)
{
for(j = 0; j < 80; j++)
{
printf("Tableau1[%d][%d] = %c\n", i, j, tableau1[i*80+j]);
}
}
}
-268
View File
@@ -1,268 +0,0 @@
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
-36
View File
@@ -1,36 +0,0 @@
int centre(void)
{
char v=0;
char b=0;
int L=0;
int C=0;
int col=0;
int lin=0;
int o=0;
while (v!='\0')
{
while (b!='\n')
{
b= fgetc(fichier);
C++;
}
// v= fgetc(fichier);peut etre pas besoin
L++;
b=0;
}
col=(80-C)/2;
lin=(80-L)/2;
for (o=80*lin+col+1; o<=80*24-(80*lin+col+1); o++)
{
v=0;
v= fgetc(fichier);
tableau1[o]=v;
if (o%80==79-col)
{
o+=C+1;
}
}
return 0;
}
-59
View File
@@ -1,59 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int h=0;
int m=0;
int s=0;
while(1)
{
time_t secondes;
struct tm instant;
time(&secondes);
instant=*localtime(&secondes);
h==instant.tm_hour;
m==instant.tm_min;
s==instant.tm_sec;
if (instant.tm_hour>12)
{
printf("c'est l'apres midi \n");
}
if (instant.tm_hour<12)
{
printf("c'est le matin \n");
}
if (instant.tm_min>38)
{
printf("deuxieme moitié de minute \n");
}
if (instant.tm_min<38)
{
printf("première moitié de minute \n");
}
if (instant.tm_sec>30)
{
printf("deiuxieme moitié de minute \n");
}
if (instant.tm_sec<30)
{
printf("première moitié de seconde \n");
}
printf("%d:%d:%d\n", instant.tm_hour, instant.tm_min, instant.tm_sec);
sleep(1);
system ("clear");
}
return 0;
}
-51
View File
@@ -1,51 +0,0 @@
/* Fichier source date_heure.c */
#include <stdio.h>
/* Donne acces à la fonction localtime()
(heure et date locales) ainsi qu'à la structure tm
qu'on utilise ci-dessous.
*/
#include <time.h>
/*
Tableaux utilisés pour convertir un code de jour de semaine (entre 0 et 6) ou de mois
(entre 0 et 11) en une chaîne de caractères.
[Ignorer complètement le "static" et les "const" ne nuit pas à la compréhension.]
*/
static const char *const jours[7] =
{ "dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"
};
static const char *const mois[12] =
{ "janvier", "fevrier", "mars", "avril", "mai", "juin",
"juillet", "août", "septembre", "octobre", "novembre", "décembre"
};
int main (void)
{
FILE* fichier = NULL;
fichier = fopen("test.txt", "w");
/* On place une date "abstraite" dans date_heures_actuelles. */
time_t date_heures_actuelles = time (NULL);
/*
Pointeur vers une structure tm dont le type est défini dans le fichier de la bibliothèque standard time.h .
Les membres de cette structure tm permettent de lire l'année, le mois, etc correspondant à une date donnée.
En initialisant la structure avec localtime(&date_heures_actuelles), on place dans les membres de la structure
l'année actuelle, le mois actuel, etc.
Restera plus qu'a rendre comprehensibles ces valeurs en utilisant les tableaux ci-dessus pour convertir les "codes" retournés.
*/
struct tm *temps_humain = localtime (&date_heures_actuelles);
int annee, i_mois, jour_mois, i_jour_semaine, heures, minutes, secondes;
/* Les instructions ci-dessous accedent à différents membres de la structure temps_humain . */
annee = 1900 + temps_humain->tm_year;
jour_mois = temps_humain->tm_mday;/* "month day" */
i_mois = temps_humain->tm_mon;/* indice du mois */
i_jour_semaine = temps_humain->tm_wday;/* "week day". dimanche = 0, lundi = 1, etc */
heures = temps_humain->tm_hour;
minutes = temps_humain->tm_min;
secondes = temps_humain->tm_sec;
/* Affichage compréhensible de la date et de l'heure courantes. */
fprintf (fichier,"utilisation: %s %d %s %d ", jours[i_jour_semaine], jour_mois,
mois[i_mois], annee);
fprintf (fichier,": %d h %d min %d s. avec un affichage:", heures, minutes, secondes);
fclose(fichier);
return 0;
}
-96
View File
@@ -1,96 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
FILE* ouverture(int temps);
int main()
{
int h=0;
int m=0;
int s=0;
FILE* fichier_h=NULL;/*differents fichiers qui permettent d'ouvrir les fichiers pbm des dizaines d heure , heures , dizaines de minutes ...*/
FILE* fichier_h2=NULL;
FILE* fichier_m=NULL;
FILE* fichier_m2=NULL;
FILE* fichier_s=NULL;
FILE* fichier_s2=NULL;
while(1)
{
time_t secondes;
struct tm instant;
time(&secondes);
instant=*localtime(&secondes);
h=instant.tm_hour;/*recupere l heure dans les variables h m et s*/
m=instant.tm_min;
s=instant.tm_sec;
int dizaines_h = h/10;
int unites_h = h%10;
int dizaines_m = m/10;
int unites_m = m%10;
int dizaines_s = s/10;
int unites_s = s%10;
printf("%d %d\n",dizaines_h,unites_h);/*extrait */
printf("%d %d\n",dizaines_m,unites_m);
printf("%d %d\n",dizaines_s,unites_s);
fichier_h=ouverture(dizaines_h);
fichier_h2=ouverture(unites_h);
fichier_m=ouverture(dizaines_m)
fichier_m2=ouverture(unites_m)
fichier_s=ouverture(dizaines_s)
fichier_s2=ouverture(unites_s)
system("sleep 1");
system ("clear");
}
return 0;
}
FILE* ouverture(int temps) {//----ouverture
FILE* fichier=NULL;
switch(temps)
{
case 0:
fichier = fopen("0","r");
break;
case 1:
fichier = fopen("1","r");
break;
case 2:
fichier = fopen("2","r");
break;
case 3:
fichier = fopen("3","r");
break;
case 4:
fichier = fopen("4","r");
break;
case 5:
fichier = fopen("5","r");
break;
case 6:
fichier = fopen("6","r");
break;
case 7:
fichier = fopen("7","r");
break;
case 8:
fichier = fopen("8","r");
break;
case 9:
fichier = fopen("9","r");
break;
default:
break;
return fichier;
}
}//------------------------ouverture
-74
View File
@@ -1,74 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
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")
}
}
}
}
}
-40
View File
@@ -1,40 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int main()
{
FILE* fichier = NULL;
fichier = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/history.txt", "a");
int h=0;
int m=0;
int s=0;
time_t secondes;
struct tm instant;
time(&secondes);
instant=*localtime(&secondes);
h==instant.tm_hour;
m==instant.tm_min;
s==instant.tm_sec;
// printf("%d:%d:%d\n", instant.tm_hour, instant.tm_min, instant.tm_sec);
fprintf (fichier,": %d h %d min %d s. avec un affichage: ", instant.tm_hour, instant.tm_min, instant.tm_sec);
fclose(fichier);
sleep(3);
// system ("clear");
return 0;
}
-3
View File
@@ -1,3 +0,0 @@
utilisation: lundi 12 décembre 2016 : 8 h 15 min 21 s. avec un affichage: statique image: start to continue
utilisation: lundi 12 décembre 2016 : 9 h 50 min 21 s. avec un affichage: statique image: psychédélique statique image: start to continue statique image: je suis en pause statique image: jul statique image: tetris
-23
View File
@@ -1,23 +0,0 @@
P1
68 20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0
0 1 1 1 0 1 1 1 0 0 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 0
0 1 1 1 0 1 1 1 0 0 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 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0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-165
View File
@@ -1,165 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>//utile pour la creation d'un nombre aleatoire
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
/*fonction qui permet de creer le random en fonction des resultats precedents*/
int Random (int _imin, int _imax)a
{
return (_imin + (rand () % (_imax-_imin+1)));//explication ???
}
/*touche*/
//----------------------------------------------------------------------------------------------------------------------------------------------
int kbhit(void)
{
struct termios oldt, newt;
int ch;
int oldf;
tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~(ICANON | ECHO);
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
oldf = fcntl(STDIN_FILENO, F_GETFL, 0);
fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);
ch = getchar();
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
fcntl(STDIN_FILENO, F_SETFL, oldf);
if(ch != EOF)
{
ungetc(ch, stdin);
return 1;
}
return 0;
}
//----------------------------------------------------------------------------------------------------------------------------------------------
int main(int argc, char *argv[])
{
/*clear the screen , open picture and history , write type of lock screen in history */
system("clear");
FILE* fichier = NULL;
FILE* history = NULL;
history = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/history.txt", "a");
fprintf(history," statique ");
int caractereactuel = 0;//creation de notre caractere actuel
int nbrAlea;//nombre aleatoire
int linecounter = 0;//compteur de ligne
srand (time (NULL));//créer nbr alea entre 1 et 5 pour choisir entre les differentes images
nbrAlea = Random (1,5);
fprintf(history," image: ");
/*switch qui permet d'ouvrir une image en fonction d'un nombre aleatoire entre 1 et 5 */
switch(nbrAlea)
{case 1:
fichier = fopen("image1", "r");
fprintf(history," je suis en pause");
break;
case 2:
fichier = fopen("image2", "r");
fprintf(history," tetris");
break;
case 3:
fichier = fopen("image3", "r");
fprintf(history," start to continue");
break;
case 4:
fichier = fopen("image4", "r");
fprintf(history," psychédélique");
break;
case 5:
fichier = fopen("image5", "r");
fprintf(history," jul");
break;
default:
break;
}
if (fichier != NULL)//
{
// boucle de lecture des caracteres un a un
do
{
caractereactuel = fgetc(fichier); // on lit le caractere
// printf("%c", caractereactuel); // on l'affiche
//printf("%d",compt);
switch(caractereactuel)
{
case 49: //1
printf("%c",987);
break;
case 48: //0
printf("%c",240);
break;
case '\t': //tab
//printf("er");
break;
//case
default:
printf("\n");
linecounter++;
break;
}
} while (linecounter < 30 ); // on continue tant que compteurglobal n'a pas finis le fichier
fclose(fichier);
fclose(history);
}
/*
while(!kbhit())
printf("");
*/
return 0;
}
-105
View File
@@ -1,105 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <time.h>
/*pour les stats nous voulions utiliser des variables qui puissent communiquer entre les programmes au debut nous vouliosn utiliser les variables d environement mais on a pas reussi a les modifier au sein d un programme , nous avons donc decider de stocker ces variables dans des .txt pour les reutiliser aprés cependnat cela ne fonctionne pas lors de lexecution du launcher*/
int Random (int _imin, int _imax)
{return (_imin + (rand () % (_imax-_imin+1)));}
int main(int argv, char *argc){
int pid;
/*permet de stocker le nombre d utilisation dans un fichier txt*/
int car;
FILE* nbr_utilisation = NULL;
FILE* nbr_utilisation2 = NULL;
FILE* nbr_1 = NULL;//permet de stocker dans des txt le nombre de lancement des differenst fond ecrans cf point sur les stats au debut du programme
FILE* nbr_12 = NULL;
FILE* nbr_2 = NULL;
FILE* nbr_22 = NULL;
FILE* nbr_3 = NULL;
FILE* nbr_32 = NULL;
FILE* alea = NULL;
system("touch nbr_utilisation2");
nbr_utilisation=fopen("nbr_utilisation","r");
nbr_utilisation2=fopen("nbr_utilisation2","w");
car=fgetc(nbr_utilisation);
car=car+1;
fprintf(nbr_utilisation2,"%c",car);
fclose(nbr_utilisation2);
fclose(nbr_utilisation);
system("mv nbr_utilisation2 nbr_utilisation");
int nbrAlea;//nombre aleatoire
int nbrAlea2;//nombre aleatoire
pid=fork();
srand (time (NULL));//créer nbr alea entre 1 et 3
nbrAlea = Random (1,2);//creation d un nbr alea entre 1 et 2 car tout les autres types ne sont pas fais
nbrAlea2= Random (1,5);
switch(pid)
{case -1:
printf("error");
break;
case 0:
switch(nbrAlea)
{
case 1:
/*permet de stocker le nombre d utilisation dans un fichier txt, il exprime le nombre d utilisation de la fonction statique*/
system("touch nbr_12");
nbr_1=fopen("nbr_1","r");
nbr_12=fopen("nbr_12","w");
system("rm alea");
alea=fopen("alea","w");
car=fgetc(nbr_1);
car=car+1;
fprintf(nbr_12,"%c",car);
fprintf(alea,"%d",nbrAlea2);
fclose(nbr_12);
fclose(nbr_1);
fclose(alea);
system("mv nbr_12 nbr_1");
execl("/home/pierre/Documents/doc/statique/lecture2", "lecture2", NULL);
break;
case 2:
/*permet de stocker le nombre d utilisation dans un fichier txt, il exprime le nombre d utilisation de la fonction dynamique*/
system("touch nbr_22");
nbr_2=fopen("nbr_2","r");
nbr_22=fopen("nbr_22","w");
car=fgetc(nbr_2);
car=car+1;
fprintf(nbr_22,"%c",car);
fclose(nbr_22);
fclose(nbr_2);
system("mv nbr_22 nbr_2");
execl("/home/pierre/Documents/doc/dynamique/dynamique", "dynamique", NULL);
break;
case 3:
/*permet de stocker le nombre d utilisation dans un fichier txt, il exprime le nombre d utilisation de la fonction interactif*/
system("touch nbr_23");
nbr_3=fopen("nbr_3","r");
nbr_32=fopen("nbr_32","w");
car=fgetc(nbr_3);
car=car+1;
fprintf(nbr_32,"%c",car);
fclose(nbr_32);
fclose(nbr_3);
system("mv nbr_32 nbr_3");
execl("/home/pierre/Documents/doc/interactif/lecture2", "lecture2", NULL);
break;
}
break;
default:
wait(NULL);
break;
}
return 0;
}
-106
View File
@@ -1,106 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <time.h>
int Random (int _imin, int _imax)
{return (_imin + (rand () % (_imax-_imin+1)));}
int main(int argv, char *argc){
int pid;
/*permet de stocker le nombre d utilisation dans un fichier txt*/
int car;
FILE* nbr_utilisation = NULL;
FILE* nbr_utilisation2 = NULL;
FILE* nbr_1 = NULL;
FILE* nbr_12 = NULL;
FILE* nbr_2 = NULL;
FILE* nbr_22 = NULL;
FILE* nbr_3 = NULL;
FILE* nbr_32 = NULL;
FILE* alea = NULL;
system("touch nbr_utilisation2");
nbr_utilisation=fopen("nbr_utilisation","r");
nbr_utilisation2=fopen("nbr_utilisation2","w");
car=fgetc(nbr_utilisation);
car=car+1;
fprintf(nbr_utilisation2,"%c",car);
fclose(nbr_utilisation2);
fclose(nbr_utilisation);
system("mv nbr_utilisation2 nbr_utilisation");
int nbrAlea;//nombre aleatoire
int nbrAlea2;//nombre aleatoire
pid=fork();
srand (time (NULL));//créer nbr alea entre 1 et 3
nbrAlea = Random (1,2);//creation d un nbr alea entre 1 et 2 car tout les autres types ne sont pas fais
nbrAlea2= Random (1,5);
switch(pid)
{case -1:
printf("error");
break;
case 0:
switch(nbrAlea)
{
case 1:
/*permet de stocker le nombre d utilisation dans un fichier txt, il exprime le nombre d utilisation de la fonction statique*/
system("touch nbr_12");
nbr_1=fopen("nbr_1","r");
nbr_12=fopen("nbr_12","w");
system("rm alea");
alea=fopen("alea","w");
car=fgetc(nbr_1);
car=car+1;
fprintf(nbr_12,"%c",car);
fprintf(alea,"%d",nbrAlea2);
fclose(nbr_12);
fclose(nbr_1);
fclose(alea);
system("mv nbr_12 nbr_1");
execl("/home/pierre/Documents/doc/statique/lecture2", "lecture2", NULL);
break;
case 2:
/*permet de stocker le nombre d utilisation dans un fichier txt, il exprime le nombre d utilisation de la fonction dynamique*/
system("touch nbr_22");
nbr_2=fopen("nbr_2","r");
nbr_22=fopen("nbr_22","w");
car=fgetc(nbr_2);
car=car+1;
fprintf(nbr_22,"%c",car);
fclose(nbr_22);
fclose(nbr_2);
system("mv nbr_22 nbr_2");
execl("/home/pierre/Documents/doc/dynamique/dynamique", "dynamique", NULL);
break;
case 3:
/*permet de stocker le nombre d utilisation dans un fichier txt, il exprime le nombre d utilisation de la fonction interactif*/
system("touch nbr_23");
nbr_3=fopen("nbr_3","r");
nbr_32=fopen("nbr_32","w");
car=fgetc(nbr_3);
car=car+1;
fprintf(nbr_32,"%c",car);
fclose(nbr_32);
fclose(nbr_3);
system("mv nbr_32 nbr_3");
execl("/home/pierre/Documents/doc/interactif/lecture2", "lecture2", NULL);
break;
}
break;
default:
wait(NULL);
break;
}
return 0;
}
-185
View File
@@ -1,185 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>//utile pour la creation d'un nombre aleatoire
int main(int argc, char *argv[])
{int nbrAlea;//nombre aleatoire
FILE* history = NULL;
FILE* compteur = NULL;
int cpt;
FILE* alea = NULL;
alea=fopen("/home/pierre/Documents/doc/alea","r");
nbrAlea=fgetc(alea);
nbrAlea=nbrAlea-48;
fclose(alea);
history = fopen("/home/pierre/Documents/doc/history.txt", "a");
fprintf(history,"date :");
system("echo $(date +%D) >> /home/pierre/Documents/doc/history.txt");
//system("gcc -o heure-vrai heure-vrai.c;./heure-vrai");
system("gcc -o heure heure.c;./heure");
/*clear the screen , open picture and history , write type of lock screen in history */
//system("clear");
FILE* fichier = NULL;
fprintf(history," statique ");
int caractereactuel = 0;//creation de notre caractere actuel
int linecounter = 0;//compteur de ligne
fprintf(history,"\n image: ");
/*switch qui permet d'ouvrir une image en fonction d'un nombre aleatoire entre 1 et 5 */
switch(nbrAlea)
{case 1:
//ces blocs sont sensé recuperer une variable dans un fichier
/*compteur=fopen("cpt_1","r");
cpt=fgetc(compteur);
cpt=cpt+1;
fclose(compteur);
system("rm cpt_1");
compteur=fopen("cpt_1","w");
fprintf(compteur,"%c",cpt);
fclose(compteur);*/
fichier = fopen("/home/pierre/Documents/doc/statique/image1-2", "r");
fprintf(history," je suis en pause\n\n");
break;
case 2:
/*compteur=fopen("cpt_2","r");
cpt=fgetc(compteur);
cpt=cpt+1;
fclose(compteur);
system("rm cpt_2");
compteur=fopen("cpt_2","w");
fprintf(compteur,"%c",cpt);
fclose(compteur);*/
fichier = fopen("/home/pierre/Documents/doc/statique/image2-2", "r");
fprintf(history," tetris\n\n");
break;
case 3:
/*compteur=fopen("cpt_3","r");
cpt=fgetc(compteur);
cpt=cpt+1;
fclose(compteur);
system("rm cpt_3");
compteur=fopen("cpt_3","w");
fprintf(compteur,"%c",cpt);
fclose(compteur);*/
fichier = fopen("/home/pierre/Documents/doc/statique/image3-2", "r");
fprintf(history," start to continue\n\n");
break;
case 4:
/*compteur=fopen("cpt_4","r");
cpt=fgetc(compteur);
cpt=cpt+1;
fclose(compteur);
system("rm cpt_4");
compteur=fopen("cpt_4","w");
fprintf(compteur,"%c",cpt);
fclose(compteur);*/
fichier = fopen("/home/pierre/Documents/doc/statique/image4-2", "r");
fprintf(history," psychédélique\n\n");
break;
case 5:
/*compteur=fopen("cpt_5","r");
cpt=fgetc(compteur);
cpt=cpt+1;
fclose(compteur);
system("rm cpt_5");
compteur=fopen("cpt_5","w");
fprintf(compteur,"%c",cpt);
fclose(compteur);*/
fichier = fopen("/home/pierre/Documents/doc/statique/image5-2", "r");
fprintf(history," exia\n\n");
break;
}
if (fichier != NULL)//
{
// boucle de lecture des caracteres un a un
do
{
caractereactuel = fgetc(fichier); // on lit le caractere
// printf("%c", caractereactuel); // on l'affiche
//printf("%d",compt);
switch(caractereactuel)
{
case 49: //1
printf("%c",987);//affiche carré blanc
break;
case 48: //0
printf("%c",240);//affiche espace
break;
case '\t': //tab
//printf("er");
break;
case 848://P
//printf("\n");
break;
default:
printf("\n ");
linecounter++;
break;
}
} while (linecounter < 28 ); // on continue tant que compteurglobal n'a pas finis le fichier
fclose(fichier);
fclose(history);
}
system("stty cbreak echo");
getchar();
system("stty cooked echo");
system("clear");
return 0;
}
-40
View File
@@ -1,40 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
int main()
{
while (1)
{
printf("-1 type d'ecran de veille \n");
printf("-2 nom du fichier\n");
int touche=0;
printf("veulliez choisir l action a execute ");
scanf ("%d" ,&touche);
switch (touche)//permet de selectionner une entré du menu
{
case 1:
printf("l'ecran de veille statique a ete lance 5 fois les 10 derniere fois \n");//a modifier avec les parametre de l'historique
char c = fgetc(stdin);
c=0;
do
{
c = fgetc(stdin);
}while (c != '\n');//permet de faire une pause tant que l'on appuis pas sur la touche entré
system ("clear");//permer d'effacer la console
break;
case 2:
printf("le fichier... a ete lance 3 fois les 10 derniere fois");//a modifier avec les parametre de l'historique
char v = fgetc(stdin);
v=0;
do
{
v = fgetc(stdin);//permet de faire une pause tant que l'on appuis pas sur la touche entré
}while (v != '\n');
system ("clear");//permer d'effacer la console
break;
}
}
return 0;
}
-1
View File
@@ -1 +0,0 @@
df
-34
View File
@@ -1,34 +0,0 @@
int centre(void)
{
char v=0;
char b=0;
int L=0;
int C=0;
int col=0;
int lin=0;
int o=0;
while (v!='\0')
{
while (b!='\n')
{
b= fgetc(fichier);
C++;
}
// v= fgetc(fichier);peut etre pas besoin
L++;
b=0;
}
col=(80-C)/2;
lin=(80-L)/2;
for (o=80*lin+col+1; o<=80*24-(80*lin+col+1); o++)
{
v=0;
v= fgetc(fichier);
tableau1[o]=v;
if (o%80==79-col)
{
o+=C+1;
}
}
return 0;
}
-132
View File
@@ -1,132 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>//utile pour la creation d'un nombre aleatoire
/*fonction qui permet de creer le random en fonction des resultats precedents*/
int Random (int _imin, int _imax)
{
return (_imin + (rand () % (_imax-_imin+1)));//explication ???
}
int main(int argc, char *argv[])
{
system("gcc -o heure-vrai heure-vrai.c;./heure-vrai");
/*clear the screen , open picture and history , write type of lock screen in history */
//system("clear");
FILE* fichier = NULL;
FILE* history = NULL;
history = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/history.txt", "a");
fprintf(history," statique ");
int caractereactuel = 0;//creation de notre caractere actuel
int nbrAlea;//nombre aleatoire
int linecounter = 0;//compteur de ligne
srand (time (NULL));//créer nbr alea entre 1 et 5 pour choisir entre les differentes images
nbrAlea = Random (1,5);
fprintf(history," image: ");
/*switch qui permet d'ouvrir une image en fonction d'un nombre aleatoire entre 1 et 5 */
switch(nbrAlea)
{case 1:
fichier = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/statique/image1-2", "r");
fprintf(history," je suis en pause");
break;
case 2:
fichier = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/statique/image2-2", "r");
fprintf(history," tetris");
break;
case 3:
fichier = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/statique/image3-2", "r");
fprintf(history," start to continue");
break;
case 4:
fichier = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/statique/image4-2", "r");
fprintf(history," psychédélique");
break;
case 5:
fichier = fopen("/media/groupe-tvp/b919f1b0-9122-4865-a76b-bb6386984916/doc/statique/image5-2", "r");
fprintf(history," jul");
break;
default:
break;
}
if (fichier != NULL)//
{
// boucle de lecture des caracteres un a un
do
{
caractereactuel = fgetc(fichier); // on lit le caractere
// printf("%c", caractereactuel); // on l'affiche
//printf("%d",compt);
switch(caractereactuel)
{
case 49: //1
printf("%c",987);//affiche carré blanc
break;
case 48: //0
printf("%c",240);//affiche espace
break;
case '\t': //tab
//printf("er");
break;
case 848://P
//printf("\n");
break;
default:
printf("\n ");
linecounter++;
break;
}
} while (linecounter < 28 ); // on continue tant que compteurglobal n'a pas finis le fichier
fclose(fichier);
fclose(history);
}
system("stty cbreak -echo");
getchar();
system("stty cooked -echo");
system("clear");
return 0;
}