Merge branch 'master' of dwarves.iut-fbleau.fr:keraudre/SAE11_2023

This commit is contained in:
Yann KERAUDREN 2023-12-12 16:18:33 +01:00
commit b43956a0a6

@ -3,13 +3,92 @@
#include <stdlib.h>
#include <graph.h>
#include <stdio.h>
void ajout_scorescore (unsigned int compteur) {
/*int main(unsigned int compteur) {
compteur = compteur + 5;
char* a= (int) compteur;
EcrireTexte(1250, 600, a, 2);
}*/
/*
int main() {
int compteur = 10;
compteur = compteur + 5;
char a[20];
sprintf(a, "%d", compteur);
EcrireTexte(1250, 600, a, 2);
return 0;
}
*/
void ajout_score(int* compteur) {
char a[20];
*compteur = *compteur + 5;
sprintf(a, "%d", *compteur);
InitialiserGraphique();
CreerFenetre(10,10,1450,840);
EcrireTexte(1250, 600, a, 2);
Touche();
FermerGraphique();
}
int main(void) {
int *compteur = NULL;
compteur = malloc(sizeof(int));
*compteur = 0;
ajout_score(compteur);
free(compteur);
return EXIT_SUCCESS;
}
/*
int main() {
int compteur = 0;
char key;
printf("Appuyez sur ESPACE pour ajouter 5 (Appuyez sur 'q' pour quitter)\n");
while (1) {
key = getchar();
if (key == ' ') {
compteur += 5;
printf("Compteur : %d\n", compteur);
} else if (key == 'q' || key == 'Q') {
printf("Sortie du programme.\n");
break;
}
}
return 0;
}
*/