mise à jour
This commit is contained in:
38
snake/time.c
38
snake/time.c
@@ -11,15 +11,21 @@ int main(void) {
|
||||
|
||||
unsigned long suivant;
|
||||
|
||||
unsigned int secondes = 0, minutes = 0;
|
||||
/* int* time = NULL; */
|
||||
|
||||
/* time = malloc( sizeof(short int));
|
||||
|
||||
time[0] = 0;
|
||||
time[1] = 0; */
|
||||
|
||||
|
||||
suivant = Microsecondes() + CYCLE;
|
||||
|
||||
printf("%d : %d\n", minutes, secondes);
|
||||
/*printf("%d : %d\n", &time[0],&time[1]);*/
|
||||
|
||||
while (1) {
|
||||
|
||||
if (Microsecondes() > suivant) {
|
||||
if (Microsecondes() > suivant) {
|
||||
|
||||
|
||||
|
||||
@@ -28,17 +34,16 @@ int main(void) {
|
||||
|
||||
suivant = Microsecondes()+CYCLE;
|
||||
|
||||
secondes++;
|
||||
/*time[1]++;
|
||||
|
||||
if ( secondes == 60) {
|
||||
if ( time[1] == 60) {
|
||||
|
||||
secondes = 0;
|
||||
time[1] = 0;
|
||||
|
||||
minutes ++;
|
||||
time[0] ++;
|
||||
|
||||
}
|
||||
|
||||
printf("%d : %d\n", minutes,secondes);
|
||||
}*/
|
||||
printf("%lu", Microsecondes());
|
||||
|
||||
|
||||
|
||||
@@ -47,8 +52,19 @@ int main(void) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* if ( ToucheEnAttente() == 1 ) {
|
||||
|
||||
if (Touche() == XK_space) {
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user