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