This commit is contained in:
Titouan LERICHE 2023-12-10 20:51:37 +01:00
commit 81aa9fae9b
6 changed files with 79 additions and 22 deletions

BIN
.DS_Store vendored

Binary file not shown.

@ -12,7 +12,7 @@ OFILES = plateau_init.o \
CC = gcc
CFLAGS = -ansi -pedantic -lgraph -I/usr/local/include
CFLAGS = -ansi -pedantic -lgraph
### REGLES ESSENTIELLES ###
@ -32,7 +32,7 @@ run : $(OFILES)
### NETTOYAGE DES FICHIERS GENERES ###
clean :
-rm -f $(OFILES) lancement *~
-rm -f $(OFILES) lancement *~ a.out

@ -10,12 +10,34 @@
#include "update_queue.h"
int** deplacement(int* p) {
int** deplacement(int* p, int timer) {
int i, j;
int* tete = NULL, queue = NULL;
char sens;
/* avancement du serpent */
/* alloacation des tableau tete et queue qui prendront les coordonnées de la tête et la queue */
tete = malloc(2*sizeof(short int));

@ -17,6 +17,7 @@ int start (void) {
int i, j;
<<<<<<< HEAD
char* texte1 = "espace = lancer";
@ -34,6 +35,8 @@ int start (void) {
/*initialisation de la taille de la fenetre de jeux*/
CreerFenetre(10,10,1450,840);
=======
>>>>>>> 34ff1f1297db1e53f89c782b8688b2232eaddd6f
/* remplisage du fond d'écran */
@ -130,11 +133,7 @@ int start (void) {
free(tableau);
Touche();
FermerGraphique();

@ -2,13 +2,29 @@
#include <stdio.h>
#include "fenetre.h"
#include "plateau_init.h"
#include <graph.h>
int main(void) {
InitialiserGraphique();
/*initialisation de la taille de la fenetre de jeux*/
CreerFenetre(10,10,1450,840);
start();
Touche();
FermerGraphique();
return EXIT_SUCCESS;
}

@ -1,34 +1,54 @@
#include <stdlib.h>
#include <graph.h>
#include <stdio.h>
#include <maj_fenetre.h>
#include <graph.h>
#define CYCLE 10000L
#define CYCLE 1000000L
int main(void) {
unsigned long suivant;
suivant= Microsecondes()+CYCLE;
unsigned int secondes = 0, minutes = 0;
suivant = Microsecondes() + CYCLE;
while (1!=0){
printf("%d : %d\n", minutes, secondes);
if (Microsecondes()>suivant){
while (1) {
if (Microsecondes() > suivant) {
/* une periode s'est écoulé */
/* prochaine date */
/* une periode s'est écoulé */
/* prochaine date */
suivant = Microsecondes()+CYCLE;
suivant= Microsecondes()+CYCLE;
}
secondes++;
if ( secondes == 60) {
secondes = 0;
minutes ++;
}
printf("%d : %d\n", minutes,secondes);
}
return EXIT_SUCCESS;
}
}
return EXIT_SUCCESS;
}