-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
65 lines (57 loc) · 1.3 KB
/
main.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
65
#include "init.h"
#include "uci.h"
#include "xboard.h"
#include "position.h"
#include "search.h"
#include "polybook.h"
#include <string>
#include <string.h>
#include <iostream>
int main(int argc, char *argv[])
{
initAll();
Position pos;
searchInfo info;
initHashTable(pos.hashTable, 128);
std::cout << "Welcome to " << name << " made by Lokesh\nType 'wuttang' for console mode...\n";
std::string input;
for (int argNum = 0; argNum < argc; ++argNum)
{
if (!strncmp(argv[argNum], "NoBook", 6))
{
engineOptions.useBook = false;
}
}
while (true)
{
std::cin.sync();
std::getline(std::cin, input);
if (input == "uci")
{
UCI_loop(pos, info);
}
else if (input == "xboard")
{
XBoard_loop(pos, info);
}
else if (input == "wuttang")
{
Console_loop(pos, info);
}
else if (input == "quit")
{
info.quit = true;
}
else
{
std::cout << "Unknown command\n";
}
if (info.quit)
{
break;
}
}
delete []pos.hashTable.pTable;
cleanPolyBook();
return 0;
}