forked from luckymark/wuziqi2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
51 lines (44 loc) · 1.34 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <bits/stdc++.h>
#include <QMainWindow>
#include<QPainter>
#include <QMouseEvent>
#include <QDebug>
#include <QMessageBox>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void in_game();
void paintEvent(QPaintEvent *); //绘图,格子间距
void mouseReleaseEvent(QMouseEvent *); //鼠标事件
bool checks(int d_x,int d_y); //AI检查在即将落子9*9周围是否有棋子
void genarator_point(std::vector <std::pair<int,int> > &v);//产生分并且记录
int score_table(int number,int emptys); //积分规则
int count_score(std::vector <int> v_v,int turn); //计算分数
int evaluate_minmax();
int min_search(int depths,int beta);
int max_search(int depths,int alpha);
void AImax_search(int &xxx,int &yyy,int depth);
int jiance(int i,int j,int team,int x,int y);
void wheelEvent(QWheelEvent *event);
const int SIZE=15;
const int WIDTH=40; //格子间距
const int x_o=50,y_o=50;
int renshu;
int player;
signals:
void gameover();
public slots:
void refresh();
private:
Ui::MainWindow *ui;
int a[15][15];
};
#endif // MAINWINDOW_H