#include #include #ifdef _WIN32 #include #else #include #endif #include "snake.h" #include "world.h" int main(void) { struct state game_state; setup_world(&game_state, 20, 10); draw_world(&game_state); while (1) { 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 } free_snake(game_state.snake); printf("\n--- KONIEC HRY ---\n"); return 0; }