-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgomoku.cpp
More file actions
102 lines (91 loc) · 1.98 KB
/
Copy pathgomoku.cpp
File metadata and controls
102 lines (91 loc) · 1.98 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//pfyakking
#define QiPu
#ifdef UNUSED
#elif defined(__GNUC__)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif
//pfyakking
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#include <windows.h>
#define il inline
#define For(i, a, b) for (int i = a; i <= b; i++)
using namespace std;
int x, y, now, win1, win2;
vector<vector<int>/**/> a;
#include "cpp/prepare.h"
namespace usr {
#include "usr.cpp"
}
namespace lv0 {
#include "ai/lv0.cpp"
}
namespace lv1 {
#include "ai/lv1.cpp"
}
namespace lv2 {
#include "ai/lv2.cpp"
}
namespace lv3 {
#include "ai/lv3.cpp"
}
namespace lv4 {
#include "ai/lv4.cpp"
}
namespace lv5 {
#include "ai/lv5.cpp"
}
pair <int,int> run(vector<vector<int> >a,int now,int test) {
if(test==-1) {
if(usr::lvl==0) return lv0::ak(a,now);
else if(usr::lvl==1) return lv1::ak(a,now);
else if(usr::lvl==2) return lv2::ak(a,now);
else if(usr::lvl==3) return lv3::ak(a,now);
else if(usr::lvl==4) return lv4::ak(a,now);
else if(usr::lvl==5) return lv5::ak(a,now);
} else {
if(test==0) return lv0::ak(a,now);
else if(test==1) return lv1::ak(a,now);
else if(test==2) return lv2::ak(a,now);
else if(test==3) return lv3::ak(a,now);
else if(test==4) return lv4::ak(a,now);
else if(test==5) return lv5::ak(a,now);
}
return make_pair(8,8);
}
#include "cpp/vs.h"
int main() {
freopen("log.txt","w",stdout);
cl_out();
f_out("CON");
int mode=MessageBox(NULL,"1v1->Yes,test->No","Choose mode", MB_YESNOCANCEL|MB_ICONASTERISK);
cl_out();
if(mode==6) {
f_out("CON");
puts("How many games do you want to play?");
int tot;
cin >> tot;
cl_out();
vs(tot,-1);
} else {
For(i,0,5) {
win1=win2=0;
pair <int,int> ai=vs(15,i);
if(ai.first<ai.second) {
f_out("CON");
cout<<"Congratulations! You Won AI"<<i<<" !\n";
cl_out();
} else {
f_out("CON");
cout<<"Sorry. You losed at AI"<<i<<" !\n";
cl_out();
break;
}
}
}
return 0;
}