-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboard.h
More file actions
53 lines (36 loc) · 1.2 KB
/
board.h
File metadata and controls
53 lines (36 loc) · 1.2 KB
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
42
43
44
45
46
47
48
49
50
51
#ifndef BOARD_H
#define BOARD_H
#include <stdbool.h>
#define SIZE 8
int debug3; //remove
enum colour{
WHITE,
BLACK,
NONE,
VALID
};
typedef struct position{
int row;
int col;
} position;
typedef struct disk{
enum colour type;
position pos;
} disk;
typedef struct player{
char name[20];
enum colour type;
int points;
} player;
void initializePlayers(player *player1, player *player2);
void initializeBoard(disk board[SIZE][SIZE]);
void printBoard(player *player1, player *player2, disk board [SIZE][SIZE]);
int validMove(disk played, disk board[SIZE][SIZE]);
int endsWithYourColour(disk played, int i, disk board[SIZE][SIZE]);
bool movePlayer(int playerGo, player *player1, player *player2, disk board[SIZE][SIZE]);
int findValidMove(player player1, disk board[SIZE][SIZE]);
void flipCounter(disk moveMade, player *player1, player *player2, disk board[SIZE][SIZE]);
void scanCounters(disk moveMade, player *player1, player *player2, disk board[SIZE][SIZE],int xChange,int yChange);
int returnAndFlip(disk moveMade, disk board[SIZE][SIZE], int xChange, int x, int yChange, int y);
void saveBoard(disk board[SIZE][SIZE], player player1, player player2);
#endif // BOARD_H