91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 20KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-07
  • 語言: C/C++
  • 標(biāo)簽: c語言??黑白棋??

資源簡介

只是一個(gè)簡單的黑白棋小游戲,用簡單的c語言編寫

資源截圖

代碼片段和文件信息


#include
#include
#include?
#include?//關(guān)于彩色字體及背景
#include?//getch()所需函數(shù)//無需回車
#define?N?9
void?keyboard(int);
void?twopointer();//統(tǒng)計(jì)得分
int?Wjudge(int?xint?y);//判斷白方下的子是否符合規(guī)則并執(zhí)行
int?Bjudge(int?xint?y);//判斷黑方下的子是否符合規(guī)則并執(zhí)行
bool?flag=0newflag=0check=0newcheck=0;//定義判斷變量并初始化
void?printF(char?(*p)[N]int);//輸出棋盤當(dāng)前情況的函數(shù)
char?a[N][N](*p)[N]c[N][N];//棋盤數(shù)組
int?staistajnumBnumW;//坐標(biāo)及棋子統(tǒng)計(jì)變量
time_t?first_time?end_time;//time_t在time.h中被定義為long型
double?B_timeW_timeBsum_time=0Wsum_time=0;
int?_0or1;//添加判定條件
int?xy;
void?SetColor(unsigned?short?ForeColor=7unsigned?short?BackGroundColor=0)?//顏色設(shè)定函數(shù),默認(rèn)為黑底白字?????????????????????????????????????????????????????????????????????????????????????????????????????????//可以接受/1/2個(gè)參數(shù)

{?

HANDLE?hCon?=?GetStdHandle(STD_OUTPUT_HANDLE);????

SetConsoleTextAttribute(hConForeColor|BackGroundColor);?

};

void?main()
{
printf(“★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★\n“);
printf(“☆?????????????????????少年A和他的好基友的超級(jí)黑白棋大戰(zhàn)????????????????????☆\n“);
printf(“★??????????????????????????????????????????????????????????????????????????★\n“);
printf(“☆?????????????????????????*********主菜單**********????????????????????????☆\n“);?//主菜單
printf(“★?????????????????????????*??????1.開始游戲???????*????????????????????????★\n“);
printf(“☆?????????????????????????*??????2.查看幫助???????*????????????????????????☆\n“);
printf(“★?????????????????????????*??????3.退出游戲???????*????????????????????????★\n“);
printf(“☆?????????????????????????*************************????????????????????????☆\n“);
printf(“★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★\n“);
SetColor();
int?ifdo;
ifdo=_getch()-48;
while(ifdo!=3&&ifdo!=1&&ifdo!=2)//輸入命令的判定
{
printf(“您輸入的命令有問題,請(qǐng)重新輸入:“);
ifdo=_getch()-48;
}
if(ifdo==3)
exit(0);
else?if(ifdo==2)
{
printf(“少年,百度一下你就知道了!\n“);
printf(“按任意鍵開始游戲“);
_getch();
system(“cls“);
}
else
;
printf(“黑子:少年A\n白子:少年A的好基友\n“);

for(int?count=0;count for(int?countn=0;countn {
a[count][countn]=32;
???????????c[count][countn]=32;
}
????for(int?t=1;t {
a[t][0]=t+48;
a[0][t]=t+48;
}
system(“cls“);
p=a;
p[N/2][N/2]=2;
p[N/2+1][N/2+1]=2;
p[N/2+1][N/2]=1;
p[N/2][N/2+1]=1;//初始化棋盤
printF(pN);
printf(“來吧兩位少年!按1開始大戰(zhàn)!\n“);
int?choose;
choose=_getch()-48;
while(choose!=1&&choose!=2)//輸入命令的判定
{
printf(“您輸入的命令有問題,請(qǐng)重新輸入\n:“);
choose=_getch()-48;
}
//判斷
if(choose==1)//坐標(biāo)輸入操作*******************************************************************************************************************************************
{
printf(“黑子:少年A\n白子:少年A的好基友\n“);
printf(“請(qǐng)輸入黑子坐標(biāo)如(縱坐標(biāo)?橫坐標(biāo))無子可落請(qǐng)輸入坐標(biāo)(0?0)\n“);
first_time=time(NULL);//記錄此步開始時(shí)間
scanf(“%d?%d“&x&y);//初次輸入
end_time=time(NULL);//記錄此步結(jié)束時(shí)間

for(int?cal=0;cal<((N-1)*(N-1)-4);cal++)
{

if(x==9)
exit(0);//退出
if(cal%2==_0or1)
{
if(cal!=0)
{
????if(0)
?????

評(píng)論

共有 條評(píng)論

相關(guān)資源