中国象棋C++实现

使用C语言开发中国象棋的小游戏

Chess.cpp

// includes
#include<iostream>
#include<graphics.h>
using namespace std;// 使用到的 WCHAR 字符
class CKind{
public:WCHAR ROOKS = *(_T("车"));WCHAR KNIGHTS = *_T("马");WCHAR ELEPHANTS = *_T("象");WCHAR MINISTERS = *_T("相");WCHAR MANDARINS = *_T("士");WCHAR GUARDS = *_T("仕");WCHAR KING = *_T("将");WCHAR GENERALS = *_T("帅");WCHAR CANNONS = *_T("炮");WCHAR PAWNS = *_T("卒");WCHAR SOLDIERS = *_T("兵");WCHAR PLAYER_1 = *_T("BLACK");WCHAR PLAYER_2 = *_T("RED");
};// 落子点
class Grid{int x, y;
public:Grid(){};virtual WCHAR get_name(){ return NULL; }virtual void drowReady(int x, int y){}virtual void setPlayer(WCHAR player){}virtual WCHAR getPlayer(){ return NULL; }void set_xy(int x, int y){this->x = x;this->y = y;}pair<int, int>get_xy(){pair<int, int>p(x, y);return p;}
};// 棋子
class Chess :public Grid
{WCHAR player;WCHAR name;
public:Chess(WCHAR name){this->name = name;}WCHAR get_name(){return name;}void setPlayer(WCHAR player){this->player = player;}WCHAR getPlayer(){return player;}void drowReady(int x, int y){setfillcolor(RGB(51, 205, 219));fillcircle(x, y, 27);RECT r = { x - 18, y - 18, x + 18, y + 18 };setbkcolor(RGB(51, 205, 219));if (player == *_T("BLACK")){settextcolor(BLACK);}elsesettextcolor(RED);drawtext(name, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);}
};// 棋盘
class PaneBoard{CKind ckind;int PERLENGTH;//单位长度Grid *grid[10][9];
public:PaneBoard(){PERLENGTH = 60;}//开始游戏void startGame(){initPaneGrid();CreateMap();repaint();messagewhile();closegraph();}//初始化棋盘格void initPaneGrid(){for (int i = 0; i < 9; i++){for (int j = 0; j < 10; j++){grid[i][j] = NULL;}}//敌方grid[0][0] = new Chess(ckind.ROOKS);grid[0][1] = new Chess(ckind.KNIGHTS);grid[0][2] = new Chess(ckind.ELEPHANTS);grid[0][3] = new Chess(ckind.MANDARINS);grid[0][4] = new Chess(ckind.KING);grid[0][5] = new Chess(ckind.MANDARINS);grid[0][6] = new Chess(ckind.ELEPHANTS);grid[0][7] = new Chess(ckind.KNIGHTS);grid[0][8] = new Chess(ckind.ROOKS);grid[2][1] = new Chess(ckind.CANNONS);grid[2][7] = new Chess(ckind.CANNONS);for (int i = 0; i <= 8; i += 2){grid[3][i] = new Chess(ckind.PAWNS);}//设置棋盘格坐标与属性for (int j = 0; j <= 8; j++){grid[0][j]->set_xy(PERLENGTH*(j + 1), PERLENGTH);grid[0][j]->setPlayer(ckind.PLAYER_1);}grid[2][1]->set_xy(2 * PERLENGTH, 3 * PERLENGTH);grid[2][7]->set_xy(8 * PERLENGTH, 3 * PERLENGTH);grid[2][1]->setPlayer(ckind.PLAYER_1);grid[2][7]->setPlayer(ckind.PLAYER_1);for (int i = 0; i <= 8; i += 2){grid[3][i]->set_xy((i + 1)* PERLENGTH, 4 * PERLENGTH);grid[3][i]->setPlayer(ckind.PLAYER_1);}//我方grid[9][0] = new Chess(ckind.ROOKS);grid[9][1] = new Chess(ckind.KNIGHTS);grid[9][2] = new Chess(ckind.MINISTERS);grid[9][3] = new Chess(ckind.GUARDS);grid[9][4] = new Chess(ckind.GENERALS);grid[9][5] = new Chess(ckind.GUARDS);grid[9][6] = new Chess(ckind.MINISTERS);grid[9][7] = new Chess(ckind.KNIGHTS);grid[9][8] = new Chess(ckind.ROOKS);grid[7][1] = new Chess(ckind.CANNONS);grid[7][7] = new Chess(ckind.CANNONS);for (int i = 0; i <= 8; i += 2){grid[6][i] = new Chess(ckind.SOLDIERS);}//设置棋盘格坐标与属性for (int j = 0; j <= 8; j++){grid[9][j]->set_xy(PERLENGTH*(j + 1), 10 * PERLENGTH);grid[9][j]->setPlayer(ckind.PLAYER_2);}grid[7][1]->set_xy(2 * PERLENGTH, 8 * PERLENGTH);grid[7][7]->set_xy(8 * PERLENGTH, 8 * PERLENGTH);grid[7][1]->setPlayer(ckind.PLAYER_2);grid[7][7]->setPlayer(ckind.PLAYER_2);for (int i = 0; i <= 8; i += 2){grid[6][i]->set_xy((i + 1)* PERLENGTH, 7 * PERLENGTH);grid[6][i]->setPlayer(ckind.PLAYER_2);}}//创建窗口void CreateMap(){initgraph(10 * PERLENGTH, 11 * PERLENGTH);//单位宽度setbkcolor(WHITE);cleardevice();}//重绘棋盘void repaint(){setbkcolor(WHITE);cleardevice();setlinecolor(BLACK);setlinestyle(PS_SOLID | PS_JOIN_BEVEL, 3);line(PERLENGTH - 5, PERLENGTH - 5, PERLENGTH * 9 + 5, PERLENGTH - 5);line(PERLENGTH - 5, PERLENGTH - 5, PERLENGTH - 5,PERLENGTH*10+5);line(PERLENGTH - 5, PERLENGTH * 10 + 5, PERLENGTH * 9 + 5, PERLENGTH * 10 + 5);line(PERLENGTH * 9 + 5, PERLENGTH * 10 + 5, PERLENGTH * 9 + 5, PERLENGTH - 5);setlinestyle(PS_SOLID | PS_JOIN_BEVEL, 2);for (int i = 1; i <= 10; i++){line(PERLENGTH, i*PERLENGTH, 9 * PERLENGTH, i*PERLENGTH);}for (int i = 1; i <= 9; i++){line(i*PERLENGTH, PERLENGTH, i* PERLENGTH, 5 * PERLENGTH);line(i*PERLENGTH, 6 * PERLENGTH, i* PERLENGTH, 10 * PERLENGTH);}line(PERLENGTH, 5 * PERLENGTH, PERLENGTH, 6 * PERLENGTH);line(9 * PERLENGTH, 5 * PERLENGTH, 9 * PERLENGTH, 6 * PERLENGTH);line(4 * PERLENGTH, PERLENGTH, 6 * PERLENGTH, 3 * PERLENGTH);line(4 * PERLENGTH, 3 * PERLENGTH, 6 * PERLENGTH, PERLENGTH);line(4 * PERLENGTH, 8 * PERLENGTH, 6 * PERLENGTH, 10 * PERLENGTH);line(4 * PERLENGTH, 10 * PERLENGTH, 6 * PERLENGTH, 8 * PERLENGTH);settextcolor(RED);settextstyle(PERLENGTH * 2 / 3, 0, _T("楷体"));RECT r = { 2 * PERLENGTH, 5 * PERLENGTH, 4 * PERLENGTH, 6 * PERLENGTH };drawtext(_T("楚河"), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);r = { 6 * PERLENGTH, 5 * PERLENGTH, 8 * PERLENGTH, 6 * PERLENGTH };drawtext(_T("汉界"), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);for (int i = 3; i <= 7; i += 2){//敌方line(i * PERLENGTH - 3, 4 * PERLENGTH - 3, i * PERLENGTH - 3, 4 * PERLENGTH - 10);line(i * PERLENGTH - 3, 4 * PERLENGTH - 3, i * PERLENGTH - 10, 4 * PERLENGTH - 3);line(i * PERLENGTH - 3, 4 * PERLENGTH + 3, i * PERLENGTH - 3, 4 * PERLENGTH + 10);line(i * PERLENGTH - 3, 4 * PERLENGTH + 3, i * PERLENGTH - 10, 4 * PERLENGTH + 3);line(i * PERLENGTH + 3, 4 * PERLENGTH - 3, i * PERLENGTH + 3, 4 * PERLENGTH - 10);line(i * PERLENGTH + 3, 4 * PERLENGTH - 3, i * PERLENGTH + 10, 4 * PERLENGTH - 3);line(i * PERLENGTH + 3, 4 * PERLENGTH + 3, i * PERLENGTH + 3, 4 * PERLENGTH + 10);line(i * PERLENGTH + 3, 4 * PERLENGTH + 3, i * PERLENGTH + 10, 4 * PERLENGTH + 3);//我方line(i * PERLENGTH - 3, 7 * PERLENGTH - 3, i * PERLENGTH - 3, 7 * PERLENGTH - 10);line(i * PERLENGTH - 3, 7 * PERLENGTH - 3, i * PERLENGTH - 10, 7 * PERLENGTH - 3);line(i * PERLENGTH - 3, 7 * PERLENGTH + 3, i * PERLENGTH - 3, 7 * PERLENGTH + 10);line(i * PERLENGTH - 3, 7 * PERLENGTH + 3, i * PERLENGTH - 10, 7 * PERLENGTH + 3);line(i * PERLENGTH + 3, 7 * PERLENGTH - 3, i * PERLENGTH + 3, 7 * PERLENGTH - 10);line(i * PERLENGTH + 3, 7 * PERLENGTH - 3, i * PERLENGTH + 10, 7 * PERLENGTH - 3);line(i * PERLENGTH + 3, 7 * PERLENGTH + 3, i * PERLENGTH + 3, 7 * PERLENGTH + 10);line(i * PERLENGTH + 3, 7 * PERLENGTH + 3, i * PERLENGTH + 10, 7 * PERLENGTH + 3);}for (int i = 2; i <= 8; i += 6)for (int j = 3; j <= 8; j += 5){line(i * PERLENGTH - 3, j * PERLENGTH - 3, i * PERLENGTH - 3, j * PERLENGTH - 10);line(i * PERLENGTH - 3, j * PERLENGTH - 3, i * PERLENGTH - 10, j * PERLENGTH - 3);line(i * PERLENGTH - 3, j * PERLENGTH + 3, i * PERLENGTH - 3, j * PERLENGTH + 10);line(i * PERLENGTH - 3, j * PERLENGTH + 3, i * PERLENGTH - 10, j * PERLENGTH + 3);line(i * PERLENGTH + 3, j * PERLENGTH - 3, i * PERLENGTH + 3, j * PERLENGTH - 10);line(i * PERLENGTH + 3, j * PERLENGTH - 3, i * PERLENGTH + 10, j * PERLENGTH - 3);line(i * PERLENGTH + 3, j * PERLENGTH + 3, i * PERLENGTH + 3, j * PERLENGTH + 10);line(i * PERLENGTH + 3, j * PERLENGTH + 3, i * PERLENGTH + 10, j * PERLENGTH + 3);}for (int j = 4; j <= 7; j += 3){line(PERLENGTH + 3, j * PERLENGTH - 3, PERLENGTH + 3, j * PERLENGTH - 10);line(PERLENGTH + 3, j * PERLENGTH - 3, PERLENGTH + 10, j * PERLENGTH - 3);line(PERLENGTH + 3, j * PERLENGTH + 3, PERLENGTH + 3, j * PERLENGTH + 10);line(PERLENGTH + 3, j * PERLENGTH + 3, PERLENGTH + 10, j * PERLENGTH + 3);}for (int j = 4; j <= 7; j += 3){line(9 * PERLENGTH - 3, j * PERLENGTH - 3, 9 * PERLENGTH - 3, j * PERLENGTH - 10);line(9 * PERLENGTH - 3, j * PERLENGTH - 3, 9 * PERLENGTH - 10, j * PERLENGTH - 3);line(9 * PERLENGTH - 3, j * PERLENGTH + 3, 9 * PERLENGTH - 3, j * PERLENGTH + 10);line(9 * PERLENGTH - 3, j * PERLENGTH + 3, 9 * PERLENGTH - 10, j * PERLENGTH + 3);}for (int i = 0; i <10; i++){for (int j = 0; j < 9; j++){if (grid[i][j] != NULL){pair<int, int>p = grid[i][j]->get_xy();int x = p.first; int y = p.second;setfillcolor(RGB(200, 220, 250));setbkcolor(RGB(200, 220, 250));fillcircle(x, y, 27);RECT r = { x - 18, y - 18, x + 18, y + 18 };if (grid[i][j]->getPlayer() == *_T("BLACK")){settextcolor(BLACK);}elsesettextcolor(RED);drawtext(grid[i][j]->get_name(), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);}}}}//进入消息循环void messagewhile(){MOUSEMSG msg;bool isReady = false;pair<int, int>p;pair<int, int>readyChess;int next = 1;//1表示红方下棋while (1){msg = GetMouseMsg();switch (msg.uMsg){case WM_LBUTTONDOWN:if (isChoose(msg.x, msg.y)){p = translate(msg.x, msg.y);//将所选坐标转化为棋盘格索引if (isReady)//如果已经有棋子被激活{if (p.first == readyChess.first&&p.second == readyChess.second)//激活之后选的是自己;{isReady = false;repaint();break;}else if (grid[p.first][p.second] == NULL)//激活之后选了一个空位置{if (!isTrueWay(grid[readyChess.first][readyChess.second]->get_name(), readyChess.first, readyChess.second, p.first, p.second))break;grid[p.first][p.second] = grid[readyChess.first][readyChess.second];pair<int, int>change = compute_xy(p.first, p.second);grid[p.first][p.second]->set_xy(change.first, change.second);grid[readyChess.first][readyChess.second] = NULL;isReady = false;repaint();next = !next;break;}else if (grid[p.first][p.second] != NULL)//激活之后,所选位置已有棋子{if (grid[p.first][p.second]->getPlayer() == grid[readyChess.first][readyChess.second]->getPlayer())//该位置是己方棋子{repaint();pair<int, int>xy = compute_xy(p.first, p.second);//根据索引计算真实坐标grid[p.first][p.second]->drowReady(xy.first, xy.second);//将棋子改为激活状态readyChess.first = p.first;//记录被激活棋子的棋盘格索引readyChess.second = p.second;isReady = true;break;}if (grid[p.first][p.second]->getPlayer() != grid[readyChess.first][readyChess.second]->getPlayer())//该位置是敌方棋子{if (!isTrueWay(grid[readyChess.first][readyChess.second]->get_name(), readyChess.first, readyChess.second, p.first, p.second))break;grid[p.first][p.second] = grid[readyChess.first][readyChess.second];pair<int, int>change = compute_xy(p.first, p.second);grid[p.first][p.second]->set_xy(change.first, change.second);grid[readyChess.first][readyChess.second] = NULL;isReady = false;repaint();next = !next;break;}}}else//如果没有棋子被激活{if (!haveChess(p.first, p.second))break;//如果所选位置没有棋子else{if (next && grid[p.first][p.second]->getPlayer() == *_T("BLACK"))break;if (!next && grid[p.first][p.second]->getPlayer() == *_T("RED"))break;pair<int, int>xy = compute_xy(p.first, p.second);//根据索引计算真实坐标grid[p.first][p.second]->drowReady(xy.first, xy.second);//将棋子改为激活状态readyChess.first = p.first;//记录被激活棋子的棋盘格索引readyChess.second = p.second;isReady = true;}}}break;}}}//棋盘格索引转化为真实坐标pair<int, int>compute_xy(int i, int j){pair<int, int>p((j + 1)*PERLENGTH, (i + 1)*PERLENGTH);return p;}//判断是否选中棋盘格bool isChoose(int x, int y){if (x > PERLENGTH / 2 && x<(10 * PERLENGTH - PERLENGTH / 2) && y>PERLENGTH / 2 && y < (11 * PERLENGTH - PERLENGTH / 2))return true;elsereturn false;}//若选中棋盘格,将所选中的坐标转化为棋盘格索引pair<int, int>translate(int x, int y){int X = x / PERLENGTH;int Y = y / PERLENGTH;int mx = x%PERLENGTH;int my = y%PERLENGTH;if (mx < PERLENGTH / 2)X--;if (my < PERLENGTH / 2)Y--;pair<int, int>p(Y, X);return p;}//判断所选棋盘格是否有棋子bool haveChess(int i, int j){if (grid[i][j] == NULL)return false;else return true;}//判断走法是否正确bool isTrueWay(WCHAR name, int row, int col, int _row, int _col){//车的限制if (name == ckind.ROOKS){if (row != _row&&col != _col)return false;if (row == row){if (col > _col){for (int i = _col + 1; i < col; i++){if (grid[row][i] != NULL)return false;}}else{for (int i = col + 1; i < _col; i++){if (grid[row][i] != NULL)return false;}}}if (col == _col){if (row > _row){for (int i = _row + 1; i < row; i++){if (grid[i][col] != NULL)return false;}}else{for (int i = row + 1; i < _row; i++){if (grid[i][col] != NULL)return false;}}}}//马的限制else if (name == ckind.KNIGHTS){if ((col - _col)*(col - _col) + (row - _row)*(row - _row) != 5)return false;//row-1,col//row+1,col//row,col-1//row,col+1//四个位置中的一个else if ((row - 1 - _row) *(row - 1 - _row) + (col - _col)*(col - _col) == 2){if (grid[row - 1][col] != NULL)return false;}else if ((row + 1 - _row) *(row + 1 - _row) + (col - _col)*(col - _col) == 2){if (grid[row + 1][col] != NULL)return false;}else if ((row - _row)*(row - _row) + (col - 1 - _col)*(col - 1 - _col) == 2){if (grid[row][col - 1] != NULL)return false;}else if ((row - _row)*(row - _row) + (col + 1 - _col)*(col + 1 - _col) == 2){if (grid[row][col + 1] != NULL)return false;}}//象的限制else if (name == ckind.ELEPHANTS){if (_row > 4)return false;else if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 8)return false;else if (grid[(row + _row) / 2][(col + _col) / 2] != NULL)return false;}//相的限制else if (name == ckind.MINISTERS){if (_row < 5)return false;else if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 8)return false;else if (grid[(row + _row) / 2][(col + _col) / 2] != NULL)return false;}//士的限制else if (name == ckind.MANDARINS){if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 2)return false;else if (_row > 2 || _col < 3 || _col>5)return false;}//仕的限制else if (name == ckind.GUARDS){if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 2)return false;else if (_row <7 || _col < 3 || _col>5)return false;}//将的限制else if (name == ckind.KING){if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 1)return false;else if (_row > 2 || _col < 3 || _col>5)return false;}//帅的限制else if (name == ckind.GENERALS){if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 1)return false;else if (_row < 7 || _col < 3 || _col>5)return false;}//炮的限制else if (name == ckind.CANNONS){int t;if (row != _row&&col != _col)return false;if (row == _row){int t = 0;if (col > _col){for (int i = _col + 1; i < col; i++){if (grid[row][i] != NULL)++t;}if (grid[_row][_col] == NULL&&t != 0)return false;if (grid[_row][_col] != NULL&&t != 1)return false;}else{for (int i = col + 1; i < _col; i++){if (grid[row][i] != NULL)++t;}cout << t;if (grid[_row][_col] == NULL&&t != 0)return false;if (grid[_row][_col] != NULL&&t != 1)return false;}}if (col == _col){t = 0;if (row > _row){for (int i = _row + 1; i < row; i++){if (grid[i][col] != NULL)++t;}cout << t << endl;if (grid[_row][_col] == NULL&&t != 0)return false;if (grid[_row][_col] != NULL&&t != 1)return false;}else{for (int i = row + 1; i < _row; i++){if (grid[i][col] != NULL)++t;}cout << t << endl;if (grid[_row][_col] == NULL&&t != 0)return false;if (grid[_row][_col] != NULL&&t != 1)return false;}}}//卒的限制else if (name == ckind.PAWNS){if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 1)return false;else if (row < 5){if (_row <= row)return false;}else if (row >= 5){if (_row < row)return false;}}//兵的限制else if (name == ckind.SOLDIERS){if ((row - _row)*(row - _row) + (col - _col)*(col - _col) != 1)return false;else if (row > 4){if (_row >= row)return false;}else if (row <= 4){if (_row > row)return false;}}return true;}
};
void main()
{PaneBoard paneBoard;paneBoard.startGame();system("pause");
}

效果图如下:

在这里插入图片描述

代码有待优化,欢迎评论区交流,更多小游戏项目可见如下地址:
https://gitee.com/liaochengliang/CPP_Practice

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/58688.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

用C++实现中国象棋

项目介绍 最近学习到了STL库&#xff0c;了解到一些很实用的容器&#xff0c;同时我也是个象棋爱好者&#xff0c;想着能不能做个象棋的游戏小程序出来&#xff0c;运用一下所学到的知识点&#xff0c;于是动手做了这个项目&#xff0c;花了两天左右的时间基本完成&#xff0c;…

C++中国象棋

ssdut c的大作业&#xff0c;在控制台的界面实现人人对弈&#xff0c;比较适合初学&#xff0c;自己设计了一些简单算法&#xff0c;两百多行完成。 以下正文&#xff1a; 完成中国象棋游戏&#xff0c;实现如下功能&#xff1a; 1.实现人与人之间象棋的对弈。 2.每次走子之…

Java版本实现中国象棋

预览效果 中国象棋 游戏介绍&#xff1a;中国象棋是起源于中国的一种棋&#xff0c;属于二人对抗性游戏的一种&#xff0c;在中国有着悠久的历史&#xff0c;由于用具简单&#xff0c;趣味性强&#xff0c;成为流行极为广泛的棋艺活动。阿巴阿巴阿巴 代码结构&#xff1a;Butto…

数影周报:小米汽车供应商被罚100万,1688延迟下线“1688买家旺旺”

本周看点&#xff1a;小米汽车供应商被罚100万&#xff1b;特斯拉将在硅谷招聘AI 人才&#xff1b;阳光出行等25款 App涉违规收集使用个人信息等&#xff1b;1688延迟于2月8日下线“1688买家旺旺”&#xff1b;微蚁科技完成数千万元B轮融资...... 数据安全那些事 小米汽车供应商…

Coggle 30 Days of ML (23年7月)任务二:数据可视化

Coggle 30 Days of ML (23年7月&#xff09;任务二&#xff1a;数据可视化 任务二&#xff1a;对数据集字符进行可视化&#xff0c;统计标签和字符分布 说明&#xff1a;在这个任务中&#xff0c;需要使用Pandas库对数据集的字符进行可视化&#xff0c;并统计数据集中的标签和…

阿里云服务器ECS是什么?详细介绍

阿里云服务器ECS是什么&#xff1f;云服务器和传统的物理服务器有什么区别&#xff1f;云服务器有哪些优势&#xff1f;云服务器可以什么&#xff1f;云服务器架构及云服务器包含哪些功能组件&#xff1f;阿里云百科来详细说下什么是云服务器ECS&#xff1a; 目录 阿里云服务…

使用Chrome修改user agent模拟微信内置浏览器

很多时候&#xff0c;我们需要模拟微信内置浏览器&#xff0c;今天教大家用 chrome 简单模拟。如图设置&#xff1a; F12或者右键审查元素进入开发者模式&#xff0c;点击Emulation&#xff0c;然后点击Network&#xff0c;把Spoof user agent改成Other&#xff0c;并把下面…

数据分析案例-足球运动员分析

目录 加载数据 查看数据 数据详细 ​缺值处理 异常值处理 重复值处理 运动员身高和体重分布 左脚右脚使用数量 俱乐部球员评分分析 足球运动员数是否与出生日期相关 身高与体重是否具有相关性 加载数据 #加载足球运动员数据 import numpy as np import pandas as pd impor…

如何用算法预测世界杯?

预测2021欧洲世界杯 世界杯预测结果预测的原理是什么&#xff1f;周易算卦原理算命可以解决的问题善易者不卜 人工智能预测原理预测模型&#xff1a;逻辑回归算法可以预测的问题 可以单挑整个华尔街的算法现代足球 世界杯预测结果 预测2021年欧洲世界杯&#xff0c;也是一道考…

采用 Python 机器学习预测足球比赛结果

足球是世界上最火爆的运动之一,如何运用机器学习来预测足球比赛结果,是每一个足球爱好者所向往的! 本场 Chat 适合有 Python 基础的机器学习初学者,我们带你一起熟悉机器学习的开发流程,帮你快速建立起自己的英超比赛预测模型! 你将获取到如下内容: 人工智能在线建模平…

按键精灵移动端系列 - 按键精灵IOS版 之 网络已断开,请检查网络连接.解决方案.

由于很多网友对这种问题,不知道如何处理.因本人也曾遇到过这种情况.经过不懈努力终于解决了这个神奇的BUG.长话短说上操作流程.如果觉得给力,请三连 点赞. 收藏. 转发. 谢谢您的支持. ** 1 安装雷锋源: apt.abcydia.com 2安装好雷锋源, 搜索: conditionalwifi 更新到最新版 …

按键精灵助手无法连接模拟器解决方案【适用任何模拟器】

找到按键精灵安装地址 D:\ProgramData\按键精灵\按键精灵手机助手\android 找到木木安装地址&#xff0c;并搜索adb.exe,未找到 但是在D:\Program Files (x86)\MuMu\emulator\nemu\vmonitor\bin找到 adb_server.exe 以及另外两个.dll 复制着三个文件到按键精灵上述文件夹&#…

国行版苹果 ios 按键精灵无法联网问题处理

国行版苹果手机安装按键精灵后无法联网的问题&#xff1a; 操作步骤&#xff1a; &#xff08;1&#xff09;自行把苹果手机进行越狱&#xff0c;找到并打开越狱商店“Cydia” &#xff0c;其他商店同理&#xff0c;按照如下图步骤添加 “雷锋源”&#xff0c;源地址&#xff…

网易mumu显示无法连接服务器,网易MuMu无法连接网络_网易MuMu如何实现多开

网易MuMu是由网易全方面打造的一种非常具有精品特色的游戏服务平台&#xff0c;这款游戏服务平台在下载安装之后可以直接运行电脑上的各种不同游戏和应用程序&#xff0c;同时它的兼容性是比较强的&#xff0c;有着非常流畅的操作过程&#xff0c;还可以通过智能辅助等优秀特色…

网易mumu模拟器adb连接配置

一、 网易mumu模拟器下载 二、安装模拟器到本机指定目录 1、例如&#xff1a;D:\Program Files\MuMu 2、adb文配置相关文件位于&#xff1a;D:\Program Files\MuMu\emulator\nemu\vms\myandrovm_vbox86下&#xff0c;如下图所示&#xff1a; 3、打开myandrovm_vbox86.nemu文件…

uni-app 连接不上夜神模拟器

uni-app 连接不上夜神模拟器 第一步打开运行设置 设置端口号 第二步通过cmd命令去连接模拟器 我这利用的是HX 找到&#xff1a;HBuilderX.3.1.17.20210608.full\HBuilderX\plugins\launcher\tools\adbs 直接cmd 执行下面两个命令 adb connect 127.0.0.1:62001 adb devices…

夜神模拟器无法连接网络的解决办法

我们经常会在电脑上安装安卓模拟器来玩一些手机游戏或者运行手机软件&#xff0c;但是有时候可能由于网络不好等原因导致模拟器连接不上网络。比如夜神模拟器无法连接网络怎么办&#xff1f;下面就来看看解决的办法。 夜神模拟器无法连接网络怎么办&#xff1a; 1、同时按下“w…

按键精灵手机助手如何连接安卓版按键精灵如何连接手机助手

通过上述讲解过的按键精灵如何下载文章得知,按键精灵手机版分为两个版本,分别为安卓版和IOS版,都是需要连接在按键精灵手机助手运行,按键精灵手机助手则必须在电脑上安装运行。好的,下面我们就来逐步讲解一下,手机版按键精灵如何使用。 首先,我们打开已经安装完成的按键…

天天模拟器显示获取服务器失败,天天模拟器无法联网怎么办-天天模拟器不能上网的解决方法 - 河东软件园...

天天模拟器是目前最热门的安卓模拟器软件&#xff0c;这是国内自主研发的一款优秀模拟器&#xff0c;其采用了持OpenGL硬件加速技术&#xff0c;能够帮助用户稳定的运行各类安卓应用&#xff0c;&#xff0c;并且具备了应用多开&#xff0c;软件具备了操作简单、稳定流畅等诸多…

qq手机助手连接服务器失败是什么原因,按键精灵手机助手教程,按键精灵手机助手连不上手机解决方法...

下面是按键精灵手机助手教程&#xff0c;按键精灵手机助手连不上手机解决方法 一、打开已安装的软件并单击[新建脚本]以创建新的游戏脚本 二、单击[我的脚本]查看创建或下载的脚本 三、点击[移动连接]将您的移动电话与数据线连接&#xff0c;方便测试脚本 我们得到了根用户的许…