This commit is contained in:
Саша 2025-05-13 18:28:02 +02:00
parent 54883b281c
commit 69de444a34

View File

@ -1,11 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include "snake.h"
#include "world.h"
@ -20,19 +15,15 @@ int main(void) {
char command = read_input();
change_direction(&game_state, command);
int outcome = step_state(&game_state);
draw_world(&game_state);
if (outcome != END_CONTINUE) {
break;
}
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
sleep(1);
}
free_snake(game_state.snake);
@ -40,3 +31,4 @@ int main(void) {
return 0;
}