2021-11-15 08:57:27 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#ifndef HEADER_2048
|
|
|
|
#define HEADER_2048
|
|
|
|
|
|
|
|
typedef enum Direction {
|
2021-11-15 10:00:37 +00:00
|
|
|
NoDirection,
|
|
|
|
Up,
|
|
|
|
Down,
|
|
|
|
Right,
|
|
|
|
Left
|
2021-11-15 08:57:27 +00:00
|
|
|
} Direction;
|
|
|
|
|
|
|
|
typedef struct Game
|
|
|
|
{
|
|
|
|
uint32_t score;
|
2021-11-15 21:20:16 +00:00
|
|
|
size_t field_size_x, field_size_y;
|
2021-11-15 08:57:27 +00:00
|
|
|
uint16_t **field;
|
|
|
|
} Game;
|
|
|
|
|
2021-11-15 21:20:16 +00:00
|
|
|
Game game_init(size_t field_size_x, size_t field_size_y);
|
2021-11-15 08:57:27 +00:00
|
|
|
uint8_t game_move(Game *game, Direction direction);
|
|
|
|
void game_destroy(Game game);
|
|
|
|
|
|
|
|
#endif
|