refresh
This commit is contained in:
parent
54883b281c
commit
69de444a34
14
a3/main.c
14
a3/main.c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user