]> git.lizzy.rs Git - ttfe.git/blob - main.h
Print game over message after quit from alternative screen
[ttfe.git] / main.h
1 #ifndef BOARD_H_
2 #define BOARD_H_
3
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <stdbool.h>
7 #include <assert.h>
8 #include <time.h>
9 #include <unistd.h>
10 #include <termios.h>
11
12 typedef struct board board;
13 typedef unsigned int uint;
14 typedef unsigned long ulong;
15
16 enum direction {
17         north,
18         south,
19         west,
20         east,
21         quit,
22 };
23
24 struct board {
25         uint x[4][4];
26         uint points;
27         uint num_p;
28 };
29
30 board *new_board();
31 void init_board(board*);
32 void free_board(board*);
33 bool move_possible_any(board*);
34 bool move_possible(board*, const int d);
35 void make_move(board*, const int d);
36 void move(board*, const int d);
37
38 void print_board(board*);
39 void print_score(board*);
40
41 #endif