]> git.lizzy.rs Git - ttfe.git/blob - main.h
Colored numbers
[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 #include <string.h>
12
13 typedef struct board board;
14 typedef unsigned int uint;
15 typedef unsigned long ulong;
16
17 enum direction {
18         north,
19         south,
20         west,
21         east,
22         quit,
23 };
24
25 struct board {
26         uint x[4][4];
27         uint points;
28         uint num_p;
29 };
30
31 board *new_board();
32 void init_board(board*);
33 void free_board(board*);
34 bool move_possible_any(board*);
35 bool move_possible(board*, const int d);
36 void make_move(board*, const int d);
37 void move(board*, const int d);
38
39 void print_board(board*);
40 void print_score(board*);
41
42 #endif