-
Notifications
You must be signed in to change notification settings - Fork 0
/
othello_shared.h
49 lines (37 loc) · 1.58 KB
/
othello_shared.h
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
#ifndef _OTHELLO_SHARED_H_
#define _OTHELLO_SHARED_H_
#ifdef __CUDACC__
#define CUDA_CALLABLE_MEMBER __host__ __device__
#define CUDA_CONSTANT __constant__ __device__
#else
#define CUDA_CALLABLE_MEMBER
#define CUDA_CONSTANT
#endif
#include <stdio.h>
#define BOARDSIZE 100
#define EMPTY 0
#define BLACK 1
#define WHITE 2
#define OUTER 3
#define WIN 99999999
#define LOSS -99999999
CUDA_CONSTANT const int ALLDIRECTIONS[8]={-11, -10, -9, -1, 1, 9, 10, 11};
CUDA_CALLABLE_MEMBER char nameof (int piece);
CUDA_CALLABLE_MEMBER int opponent (int player);
CUDA_CALLABLE_MEMBER int * copyboard (int * board);
CUDA_CALLABLE_MEMBER int * initialboard (void);
CUDA_CALLABLE_MEMBER int count (int player, int * board);
CUDA_CALLABLE_MEMBER void printboard (int * board);
CUDA_CALLABLE_MEMBER int validp (int move);
CUDA_CALLABLE_MEMBER int findbracketingpiece(int square, int player, int * board, int dir);
CUDA_CALLABLE_MEMBER int wouldflip (int move, int player, int * board, int dir);
CUDA_CALLABLE_MEMBER int legalp (int move, int player, int * board);
CUDA_CALLABLE_MEMBER void makeflips (int move, int player, int * board, int dir);
CUDA_CALLABLE_MEMBER void makemove (int move, int player, int * board);
CUDA_CALLABLE_MEMBER int anylegalmove (int player, int * board);
CUDA_CALLABLE_MEMBER int nexttoplay (int * board, int previousplayer, int printflag);
CUDA_CALLABLE_MEMBER int cudanexttoplay (int * board, int previousplayer, int printflag);
CUDA_CALLABLE_MEMBER int * legalmoves (int player, int * board);
CUDA_CALLABLE_MEMBER int diffeval (int player, int * board);
typedef int (* fpc) (int, int *);
#endif