#include #include #include #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; } sleep(1); } free_snake(game_state.snake); printf("\n--- KONIEC HRY ---\n"); return 0; }