-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjarvaang.c
75 lines (64 loc) · 1.71 KB
/
jarvaang.c
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
65
66
67
68
69
70
71
72
73
74
75
// jarvaang.c
#include "stdio.h"
#include "definitions/defs.h"
#include "stdlib.h"
#include "string.h"
#define WAC1 "r1b1k2r/ppppnppp/2n2q2/2b5/3NP3/2P1B3/PP3PPP/RN1QKB1R w KQkq - 0 1"
#define PERFT "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1"
int main(int argc, char *argv[])
{
AllInit();
S_BOARD pos[1];
S_SEARCHINFO info[1];
info->quit = FALSE;
pos->HashTable->pTable = NULL;
InitHashTable(pos->HashTable, 64);
setbuf(stdin, NULL);
setbuf(stdout, NULL);
int ArgNum = 0;
for(ArgNum = 0; ArgNum < argc; ++ArgNum) {
if(strncmp(argv[ArgNum], "NoBook", 6) == 0) {
EngineOptions->UseBook = FALSE;
printf("Book Off\n");
}
}
printf("Welcome to %s! Type 'jarvis' for console mode ...\n", NAME);
char line[256];
while (TRUE)
{
memset(&line[0], 0, sizeof(line));
fflush(stdout);
if (!fgets(line, 256, stdin))
continue;
if (line[0] == '\n')
continue;
if (!strncmp(line, "uci", 3))
{
Uci_Loop(pos, info);
if (info->quit == TRUE)
break;
continue;
}
else if (!strncmp(line, "xboard", 6))
{
XBoard_Loop(pos, info);
if (info->quit == TRUE)
break;
continue;
}
else if (!strncmp(line, "mukubiGM", 8))
{
Console_Loop(pos, info);
if (info->quit == TRUE)
break;
continue;
}
else if (!strncmp(line, "quit", 4))
{
break;
}
}
free(pos->HashTable->pTable);
void CleanPolyBook();
return 0;
}