-
Notifications
You must be signed in to change notification settings - Fork 2
/
happygg.cpp
64 lines (60 loc) · 2.06 KB
/
happygg.cpp
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
56
57
58
59
60
61
62
63
64
#include <stdio.h>
#include "src/ucci.h"
#include "src/search.h"
int main(int argc, char *argv[]) {
ucci_comm_enum ucci_enum = UCCI_COMM_NONE;
ucci_comm_struct ucci_struct;
if (boot_line() == UCCI_COMM_UCCI) {
Search chess_search;
printf("id name happygg\n");
fflush(stdout);
printf("id copyright 2015\n");
fflush(stdout);
printf("id anthor Chaozz\n");
fflush(stdout);
printf("ucciok\n");
fflush(stdout);
while (ucci_enum != UCCI_COMM_QUIT) {
ucci_enum = idle_line(&ucci_struct);
switch (ucci_enum) {
case UCCI_COMM_ISREADY:
printf("readyok\n");
fflush(stdout);
break;
case UCCI_COMM_STOP:
printf("nobestmove\n");
fflush(stdout);
break;
case UCCI_COMM_BANMOVES:
break;
case UCCI_COMM_SETOPTION:
switch (ucci_struct.option.uo_type) {
case UCCI_OPTION_BATCH:
break;
case UCCI_OPTION_NEWGAME:
chess_search.InitSearch();
break;
default:
break;
}
break;
case UCCI_COMM_POSITION:
fflush(stdout);
break;
case UCCI_COMM_GO:
case UCCI_COMM_GOPONDER:
if (ucci_struct.search.ut_mode == UCCI_DEPTH) {
chess_search.ThinkMoveDepth(ucci_struct.search.depth_time.depth);
} else if (ucci_struct.search.ut_mode == UCCI_TIME) {
chess_search.ThinkMoveTime(ucci_struct.search.depth_time.time);
}
break;
default:
break;
}
}
}
printf("bye\n");
fflush(stdout);
return 0;
}