#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<ctime>
//注意,使用以下系统函数,请加上这些头文件
using namespace std;
void gotoxy(int x,int y) {
COORD pos = {x,y};
HANDLE hOut =GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut,pos);
}//将光标移动到x,y点上
int mp[16][16]= {0},x1=0,x2=0;//地图,用来搜索五子连成的
void print(int x) {
gotoxy(x,1);
cout<<"┬";
for(int i=2; i<=14; i++) {
gotoxy(x,i);
cout<<"┼";
}
gotoxy(x,15);
cout<<"┴";
}//输出棋盘的中间部分
void gotoc() {
system("cls");
gotoxy(55,10);
cout<<"五 子 棋";
gotoxy(56,20);
cout<<"加载中...";
gotoxy(55,21);
for(int j=0; j<100; j++) {
Sleep(17);
gotoxy(j+3,15);
cout<<" "<<j<<"%";
gotoxy(j,15);
cout<<"■";
}
system("cls");
for(int i=0; i<100; i++) {
for(int j=0; j<40; j++) {
gotoxy(i,j);
cout<<"■";
//SetColor(rand()%10);
}
}
system("cls");
}//加载界面函数
int main() {
gotoc();//加载
for(int i=2; i<=30; i+=2) {
gotoxy(i,0);
cout<<i/2;
}//横坐标
for(int i=1; i<=15; i++) {
gotoxy(0,i);
cout<<i;
}//纵坐标
gotoxy(2,1);
cout<<"┌";
for(int i=2; i<=14; i++) {
gotoxy(2,i);
cout<<"├";
}
gotoxy(2,15);
cout<<"└";//输出棋盘左侧
for(int i=4; i<=28; i+=2) {
print(i);
}//用一个循环来输出棋盘中间部分
gotoxy(30,1);
cout<<"┐";
for(int i=2; i<=14; i++) {
gotoxy(30,i);
cout<<"┤";
}
gotoxy(30,15);
cout<<"┘";//输出棋盘右侧
bool l=0;//没什么用的flag
lon
五子棋游戏
于 2025-02-04 14:05:00 首次发布

最低0.47元/天 解锁文章

2831

被折叠的 条评论
为什么被折叠?



