ajout fichiers maj_fenetre.c et .h
This commit is contained in:
parent
41255725d2
commit
36be240e31
20
snake/main.c
20
snake/main.c
@ -7,26 +7,6 @@
|
||||
int main(void) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
start();
|
||||
|
||||
|
6
snake/maj_fenetre.c
Normal file
6
snake/maj_fenetre.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int
|
0
snake/maj_fenetre.h
Normal file
0
snake/maj_fenetre.h
Normal file
34
snake/time.c
Normal file
34
snake/time.c
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
#include <maj_fenetre.h>
|
||||
|
||||
|
||||
|
||||
#define CYCLE 10000L
|
||||
|
||||
|
||||
int main(void) {
|
||||
|
||||
|
||||
|
||||
suivant= Microsecondes()+CYCLE;
|
||||
|
||||
|
||||
while (1!=0){
|
||||
|
||||
if (Microsecondes()>suivant){
|
||||
|
||||
|
||||
|
||||
/* une periode s'est écoulé */
|
||||
/* prochaine date */
|
||||
|
||||
suivant= Microsecondes()+CYCLE;
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user