-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathomok.h
55 lines (33 loc) · 732 Bytes
/
omok.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
50
51
52
53
54
55
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include <Windows.h>
#define SIZE 9
#define N 20
#define BLACK 2
#define WHITE 3
void putStone(int x, int y,int color);
int blackwinTest();
int whitewinTest();
void printBoard();
typedef struct tree {
struct tree *child[5];
int val;
}TREE;
typedef struct omokT {
int x;
int y;
int val;
int board[N][N];
int next;
struct omokT *child[25];
int index;
}NODE;
int eval(NODE * node);
NODE * createNode(int newX, int newY, int (*preboard)[N],int color);
NODE *createTree(NODE * root, int depth,int turn);
int alphabeta(NODE *node, int depth,int a, int b, bool Max);
void destroyTree(NODE *node);