wow!好多C++游戏代码!!!
请点击这里,请不要忘了点赞评论哦!
P.S. 我正在向他学习游戏代码编写,希望以后在本贴更新自己的游戏代码!!!
大家不要等急了,我先拿几个别人的给大家过过目!
这是四月小白的原创文章,我只转载
扫雷
#include<stdio.h>
#include<windows.h>
#include<stdlib.h>
#include<time.h>
#include<conio.h>
#include<queue>
#include<ctype.h>
#define A 17 //地图的高
#define B 17 //地图的宽
#define C 30 //雷的总数
using namespace std;
//全局变量
DWORD a,b;
char map[A][B],news,spare;
int BoomTotalNum,floatx,floaty,flag[A][B],flagnum,mode,slect[A][B],game;
//颜色属性
const WORD FORE_BLUE = FOREGROUND_BLUE; //蓝色文本属性
const WORD FORE_GREEN = FOREGROUND_GREEN; //绿色文本属性
const WORD FORE_RED = FOREGROUND_RED; //红色文本属性
//开垦地图结构体
struct node {
int x;
int y;
};
queue <node> dui;
//打印位置
void position(int x,int y) {
COORD pos={x,y};
HANDLE Out=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(Out,pos);
}
//隐藏光标
void Hide() {
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);//获取控制台光标信息
CursorInfo.bVisible = false; //隐藏控制台光标
SetConsoleCursorInfo(handle, &CursorInfo);//设置控制台光标状态
}
//初始化
void Beginning() {
while(!dui.empty()) {
dui.pop();
}
game=1;
//BoomTotalNum=C;
floatx=A/2;
floaty=B/2;
flagnum=0;
BoomTotalNum=C;
mode=0;
HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); //获得标准输出设备句柄
CONSOLE_SCREEN_BUFFER_INFO csbi; //定义窗口缓冲区信息结构体
GetConsoleScreenBufferInfo(handle_out, &csbi); //获得窗口缓冲区信息
int x,y;
srand((unsigned)time(0));
for(int i=0;i<A;i++) for(int j=0;j<B;j++) {
map[i][j]=' ';
flag[i][j]=0;
slect[i][j]=0;
}
while(BoomTotalNum) {
x=rand()%A;
y=rand()%B;
if(map[x][y]==' ') {
map[x][y]='@';
BoomTotalNum--;
}
}
SetConsoleTextAttribute(handle_out, FORE_GREEN);
for(int i=0;i<A;i++) {
for(int j=0;j<B;j++) printf("█");
printf("\n");
}
position(floaty*2,floatx);
SetConsoleTextAttribute(handle_out, FORE_RED);
printf(""); //光标位置
position(44,9);
printf("扫雷模式");
position(44,5);
printf("剩余雷数:%d ",C-flagnum);
SetConsoleTextAttribute(handle_out, FORE_GREEN);
position(5,22);
printf("按“空格”切换模式");
position(5,23);
printf("按“Enter”确认");
position(5,24);
printf("按“方向键”选择方块");
}
//打印地图的一块儿
void Lump(int xx,int yy) {
switch(map[xx][yy]) {
case '1' : printf("①");break; //周围雷的数量(下同)
case '2' : printf("②");break;
case '3' : printf("③");break;
case '4' : printf("④");break;
case '5' : printf("⑤");break;
case '6' : printf("⑥");break;
case '7' : printf("⑦");break;
case '8' : printf("⑧");break;
case ' ' :
if(xx==floatx&&yy==floaty) {
if(flag[xx][yy]==0) {
if(mode%2==0) printf("");
else printf("");
}
else printf("");
}
else {
if(flag[xx][yy]==0) printf("█");
else printf("");
}
break;
case '@' :
if(xx==floatx&&yy==floaty) {
if(flag[xx][yy]==0) {
if(mode%2==0) printf("");
else printf("");
}
else printf("");
}
else {
if(flag[xx][yy]==0) printf("█");
else printf("");
}
break;
case 'x' : if(floatx==xx&&floaty==yy) printf(""); else printf(" ");break; //已经挖开的空白
}
}
//移动光标
void Move() {
HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); //获得标准输出设备句柄
CONSOLE_SCREEN_BUFFER_INFO csbi; //定义窗口缓冲区信息结构体
GetConsoleScreenBufferInfo(handle_out, &csbi); //获得窗口缓冲区信息
int xxx,yyy;
xxx=floatx;
yyy=floaty;
switch(news) {
case 72 : floatx--;break; //上
case 80 : floatx++;break; //下
case 75 : floaty--;break; //左
case 77 : floaty++;break; //右
}
if(floatx==-1) floatx=A-1; floatx%=A; //两端穿模处理
if(floaty==-1) floaty=B-1; floaty%=B;
position(yyy*2,xxx);
SetConsoleTextAttribute(handle_out, FORE_GREEN);
Lump(xxx,yyy); //删除原位置
if(map[floatx][floaty]=='x') {
position(floaty*2,floatx);
printf(" ");
}
position(floaty*2,floatx);
SetConsoleTextAttribute(handle_out, FORE_BLUE);
Lump(floatx,floaty); //更新新位置
}
//插旗和排雷模式切换
void Mode() {
HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); //获得标准输出设备句柄
CONSOLE_SCREEN_BUFFER_INFO csbi; //定义窗口缓冲区信息结构体
GetConsoleScreenBufferInfo(handle_out, &csbi); //获得窗口缓冲区信息
mode++;
SetConsoleTextAttribute(handle_out, FORE_BLUE);
position(floaty*2,floatx);
if(mode%2==0) printf("");
else printf("");
position(44,9);
if(mode%2==0) {
SetConsoleTextAttribute(handle_out, FORE_BLUE);
printf("扫雷模式");
}
else {
SetConsoleTextAttribute(handle_out, FORE_RED);
printf("插旗模式");
}
}
//该点周围地雷数
int Boomnum(int xx,int yy) {
int num=0;
if((xx-1>=0)&&(yy-1>=0)&&(map[xx-1][yy-1]=='@')) num++;
if((xx-1>=0)&&(yy+0>=0)&&(map[xx-1][yy]=='@')) num++;
if((xx-1>=0)&&(yy+1<B) &&(map[xx-1][yy+1]=='@')) num++;
if((xx+0>=0)&&(yy-1>=0)&&(map[xx][yy-1]=='@')) num++;
if((xx+0>=0)&&(yy+1<B) &&(map[xx][yy+1]=='@')) num++;
if((xx+1<A)&&(yy-1>=0) &&(map[xx+1][yy-1]=='@')) num++;
if((xx+1<A)&&(yy+0>=0) &&(map[xx+1][yy]=='@')) num++;
if((xx+1<A)&&(yy+1<B) &&(map[xx+1][yy+1]=='@')) num++;
return num;
}
//更新地图
void Open() {
node c;
node d;
while(!dui.empty()) {
dui.pop();
}
c.x=floatx;
c.y=floaty;
dui.push(c);
slect[c.x][c.y]=1;
while(!dui.empty()) {
c=dui.front();
dui.pop();
if(Boomnum(c.x,c.y)!=0) {
map[c.x][c.y]=(Boomnum(c.x,c.y)+48);
continue;
}
else {
map[c.x][c.y]='x';
if((c.x-1>=0)&&(c.y-1>=0)&&(map[c.x-1][c.y-1]==' ')&&(slect[c.x-1][c.y-1]==0)) {
d.x=c.x-1;
d.y=c.y-1;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x-1>=0)&&(c.y-0>=0)&&(map[c.x-1][c.y]==' ')&&(slect[c.x-1][c.y]==0)) {
d.x=c.x-1;
d.y=c.y-0;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x-1>=0)&&(c.y+1<B)&&(map[c.x-1][c.y+1]==' ')&&(slect[c.x-1][c.y+1]==0)) {
d.x=c.x-1;
d.y=c.y+1;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x-0>=0)&&(c.y-1>=0)&&(map[c.x][c.y-1]==' ')&&(slect[c.x][c.y-1]==0)) {
d.x=c.x-0;
d.y=c.y-1;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x-0>=0)&&(c.y+1<B)&&(map[c.x][c.y+1]==' ')&&(slect[c.x][c.y+1]==0)) {
d.x=c.x-0;
d.y=c.y+1;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x+1<A)&&(c.y-1>=0)&&(map[c.x+1][c.y-1]==' ')&&(slect[c.x+1][c.y-1]==0)) {
d.x=c.x+1;
d.y=c.y-1;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x+1<A)&&(c.y-0>=0)&&(map[c.x+1][c.y]==' ')&&(slect[c.x+1][c.y]==0)) {
d.x=c.x+1;
d.y=c.y-0;
dui.push(d);
slect[d.x][d.y]=1;
}
if((c.x+1<A)&&(c.y+1<B)&&(map[c.x+1][c.y+1]==' ')&&(slect[c.x+1][c.y+1]==0)) {
d.x=c.x+1;
d.y=c.y+1;
dui.push(d);
slect[d.x][d.y]=1;
}
}
}
}
int main() {
freopen("排名.txt","r",stdin);
Relife: //重玩处
HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); //获得标准输出设备句柄
CONSOLE_SCREEN_BUFFER_INFO csbi; //定义窗口缓冲区信息结构体
GetConsoleScreenBufferInfo(handle_out, &csbi); //获得窗口缓冲区信息
Hide(); //隐藏光标
Beginning();//初始化地图
a=GetTickCount();
while(1) {
if(kbhit()!=0) {
spare=getch();
//按其他
if((spare!=(-32))&&(spare!=13)&&(spare!=' ')) continue;//跳过
//按Enter
if(spare==13) { //确认
//排雷
if(mode%2==0) {
if(map[floatx][floaty]=='@'&&flag[floatx][floaty]==0) {
break; //触雷
game=0;
}
if(flag[floatx][floaty]==1) continue; //有旗跳过
Open();
position(0,0);
SetConsoleTextAttribute(handle_out, FORE_GREEN);
for(int i=0;i<A;i++) {
for(int j=0;j<B;j++) Lump(i,j);
printf("\n");
}
position(floaty*2,floatx);
SetConsoleTextAttribute(handle_out, FORE_BLUE);
Lump(floatx,floaty);
}
//插拔旗
else {
//不能插旗的地方
if(map[floatx][floaty]=='x'||(map[floatx][floaty]>'0'&&map[floatx][floaty]<'9'))
continue; //跳过
//插旗
if(flag[floatx][floaty]==0) {
flagnum++;
flag[floatx][floaty]=1;
position(floaty*2,floatx);
SetConsoleTextAttribute(handle_out, FORE_BLUE);
Lump(floatx,floaty);
}
//拔旗
else {
flagnum--;
flag[floatx][floaty]=0;
position(floaty*2,floatx);
SetConsoleTextAttribute(handle_out, FORE_BLUE);
Lump(floatx,floaty);
}
}
}
//按空格
if(spare==' ') Mode(); //切换模式
//按方向键
if(spare==-32) {
news=getch();
Move(); //移动光标
}
for(int i=0;i<A;i++) for(int j=0;j<B;j++) if(map[i][j]=='x'||(map[i][j]>'0'&&map[i][j]<'9')) game++;
if(game==A*B-C+1) break;
else game=1;
SetConsoleTextAttribute(handle_out, FORE_RED);
position(44,5);
printf("剩余雷数:%d ",C-flagnum);
}
else Sleep(10);
b=GetTickCount();
SetConsoleTextAttribute(handle_out, FORE_RED);
position(44,7);
printf("用时:"); //用时
if((b-a)/60000<10) printf("0");
printf("%d:",(b-a)/60000);
if(((b-a)/1000)%60<10) printf("0");
printf("%d:",((b-a)/1000)%60);
if(((b-a)/10)%100<10) printf("0");
printf("%d",((b-a)/10)%100);
}
SetConsoleTextAttribute(handle_out, FORE_RED);
position(5,5);
if(game==1) printf("游戏结束!");
else printf("恭喜通关!");
position(5,8);
printf("任意键重玩");
scanf("%c%c",&spare,&spare);
system("cls");
position(0,0);
goto Relife;
}
石头剪刀布
这是hebedich原创文章,我只转载
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
char gamer; // 玩家出拳
int computer; // 电脑出拳
int result; // 比赛结果
// 为了避免玩一次游戏就退出程序,可以将代码放在循环中
while (1){
printf("这是一个猜拳的小游戏,请输入你要出的拳头:\n");
printf("A:剪刀\nB:石头\nC:布\nD:不玩了\n");
scanf("%c%*c",&gamer);
switch (gamer){
case 65: //A
case 97: //a
gamer=4;
break;
case 66: //B
case 98: //b
gamer=7;
break;
case 67: //C
case 99: //c
gamer=10;
break;
case 68: //D
case 100: //d
return 0;
default:
printf("你的选择为 %c 选择错误,退出...\n",gamer);
getchar();
system("cls"); // 清屏
return 0;
break;
}
srand((unsigned)time(NULL)); // 随机数种子
computer=rand()%3; // 产生随机数并取余,得到电脑出拳
result=(int)gamer+computer; // gamer 为 char 类型,数学运算时要强制转换类型
printf("电脑出了");
switch (computer)
{
case 0:printf("剪刀\n");break; //4 1
case 1:printf("石头\n");break; //7 2
case 2:printf("布\n");break; //10 3
}
printf("你出了");
switch (gamer)
{
case 4:printf("剪刀\n");break;
case 7:printf("石头\n");break;
case 10:printf("布\n");break;
}
if (result==6||result==7||result==11) printf("你赢了!");
else if (result==5||result==9||result==10) printf("电脑赢了!");
else printf("平手");
system("pause>nul&&cls"); // 暂停并清屏
}
return 0;
}
自制井字棋
@liangyanlun (发表于团队帖里),我只转载
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int n,n1,n2,n3,n4,n5,n6,n7,n8,n9,m[5][5];
void p()
{
for(int i=1;i<=7;i++)
cout<<'-';
cout<<endl;
for(int i=1;i<=3;i++)
{
cout<<'|';
if(!m[1][i])cout<<' ';
if(m[1][i]==1)cout<<'o';
if(m[1][i]==2)cout<<'x';
}
cout<<'|'<<endl;
for(int i=1;i<=7;i++)
cout<<'-';
cout<<endl;
for(int i=1;i<=3;i++)
{
cout<<'|';
if(!m[2][i])cout<<' ';
if(m[2][i]==1)cout<<'o';
if(m[2][i]==2)cout<<'x';
}
cout<<'|'<<endl;
for(int i=1;i<=7;i++)
cout<<'-';
cout<<endl;
for(int i=1;i<=3;i++)
{
cout<<'|';
if(!m[3][i])cout<<' ';
if(m[3][i]==1)cout<<'o';
if(m[3][i]==2)cout<<'x';
}
cout<<'|'<<endl;
for(int i=1;i<=7;i++)
cout<<'-';
cout<<endl;
}
void s()
{
cout<<endl<<" 井字棋5.0";
cout<<endl<<"--------------华丽的分割线--------------";
Sleep(1000);
system("cls");
cout<<"高难度井字棋";
cout<<endl;
Sleep(1000);
cout<<"制作人:";
cout<<"梁彦伦";
Sleep(500);
system("cls");
cout<<"先手后手?"<<endl<<"先手输1,后手输0";
cin>>n;
memset(m,0,sizeof(m));
cout<<endl<<"输入x行y列";
Sleep(500);
cout<<"开始!";
system("cls");
system("mode con cols=15 lines=8");
system("color ad");
p();
for(int i=0;i<=4;i++)
for(int j=0;j<=4;j++)
{
if(i==0||i==4||j==0||j==4)
m[i][j]=3;
}
}
void weixian()
{
n3=n4=0;
if(m[1][2]==1&&m[1][3]==1&&m[1][1]==0
||m[2][2]==1&&m[3][3]==1&&m[1][1]==0
||m[2][1]==1&&m[3][1]==1&&m[1][1]==0)
{
n3=1;n4=1;return;
}
if(m[1][2]==1&&m[1][1]==1&&m[1][3]==0
||m[2][2]==1&&m[3][1]==1&&m[1][3]==0
||m[2][3]==1&&m[3][3]==1&&m[1][3]==0)
{
n3=1;n4=3;return;
}
if(m[3][2]==1&&m[3][3]==1&&m[3][1]==0
||m[2][2]==1&&m[1][3]==1&&m[3][1]==0
||m[2][1]==1&&m[1][1]==1&&m[3][1]==0)
{
n3=3;n4=1;return;
}
if(m[3][2]==1&&m[3][1]==1&&m[3][3]==0
||m[2][2]==1&&m[1][1]==1&&m[3][3]==0
||m[2][3]==1&&m[1][3]==1&&m[3][3]==0)
{
n3=3;n4=3;return;
}
if(m[1][3]==1&&m[1][1]==1&&m[1][2]==0
||m[2][2]==1&&m[3][2]==1&&m[1][2]==0)
{
n3=1;n4=2;return;
}
if(m[3][3]==1&&m[3][1]==1&&m[3][2]==0
||m[1][2]==1&&m[2][2]==1&&m[3][2]==0)
{
n3=3;n4=2;return;
}
if(m[2][3]==1&&m[2][2]==1&&m[2][1]==0
||m[1][1]==1&&m[3][1]==1&&m[2][1]==0)
{
n3=2;n4=1;return;
}
if(m[3][3]==1&&m[1][3]==1&&m[2][3]==0
||m[2][1]==1&&m[2][2]==1&&m[2][3]==0)
{
n3=2;n4=3;return;
}
if(m[2][1]==1&&m[2][3]==1&&m[2][2]==0
||m[3][2]==1&&m[1][2]==1&&m[2][2]==0
||m[1][1]==1&&m[3][3]==1&&m[2][2]==0
||m[3][1]==1&&m[1][3]==1&&m[2][2]==0)
{
n3=2;n4=2;return;
}
}
int main()
{
a2:;
system("mode con cols=40 lines=10");
system("color f0");
s();
for(int i=1;i<=9;i++)
{
if((n==1&&i%2)||(n==0&&i%2==0))
{
a1:;
cin>>n1>>n2;
if(n1>3||n2>3||n1<1||n2<1||m[n1][n2])
{
cout<<"不可以乱输!";
goto a1;
}
m[n1][n2]=1;
weixian();
if(n3&&n4)
{
i++;
m[n3][n4]=2;
}
}
else
{
if(!m[2][2])
{
m[2][2]=2;
}
else
{
if(!m[1][3])
{
m[1][3]=2;
}
else
{
if(!m[3][1])
{
m[3][1]=2;
}
else
{
if(!m[1][1])
{
m[1][1]=2;
}
else
if(!m[3][3])
{
m[3][3]=2;
}else
{
if(!m[1][2])
{
m[1][2]=2;
}
else
{
if(!m[3][2])
{
m[3][2]=2;
}
else
{
if(!m[2][1])
{
m[2][1]=2;
}
else
if(!m[2][3])
{
m[2][3]=2;
}
}
}
}
}
}
}
}
system("cls");
p();
Sleep(1000);
n3=n4=0;
if(m[1][2]==1&&m[1][3]==1&&m[1][1]==1
||m[2][2]==1&&m[3][3]==1&&m[1][1]==1
||m[2][1]==1&&m[3][1]==1&&m[1][1]==1)
{
n3=1;n4=1;
}
if(m[1][2]==1&&m[1][1]==1&&m[1][3]==1
||m[2][2]==1&&m[3][1]==1&&m[1][3]==1
||m[2][3]==1&&m[3][3]==1&&m[1][3]==1)
{
n3=1;n4=3;
}
if(m[3][2]==1&&m[3][3]==1&&m[3][1]==1
||m[2][2]==1&&m[1][3]==1&&m[3][1]==1
||m[2][1]==1&&m[1][1]==1&&m[3][1]==1)
{
n3=3;n4=1;
}
if(m[3][2]==1&&m[3][1]==1&&m[3][3]==1
||m[2][2]==1&&m[1][1]==1&&m[3][3]==1
||m[2][3]==1&&m[1][3]==1&&m[3][3]==1)
{
n3=3;n4=3;
}
if(m[1][3]==1&&m[1][1]==1&&m[1][2]==1
||m[2][2]==1&&m[3][2]==1&&m[1][2]==1)
{
n3=1;n4=2;
}
if(m[3][3]==1&&m[3][1]==1&&m[3][2]==1
||m[1][2]==1&&m[3][2]==1&&m[3][2]==1)
{
n3=3;n4=2;
}
if(m[2][3]==1&&m[2][1]==1&&m[2][1]==1
||m[1][2]==1&&m[3][2]==1&&m[2][1]==1)
{
n3=2;n4=1;
}
if(m[3][3]==1&&m[1][3]==1&&m[2][3]==1
||m[2][1]==1&&m[2][2]==1&&m[2][3]==1)
{
n3=2;n4=3;
}
if(m[2][1]==1&&m[2][3]==1&&m[2][2]==1
||m[3][2]==1&&m[1][2]==1&&m[2][2]==1
||m[1][1]==1&&m[3][3]==1&&m[2][2]==1
||m[3][1]==1&&m[1][3]==1&&m[2][2]==1)
n3=2;n4=2;
if(n3&&n4)
{
Sleep(1000);
system("cls");
cout<<"你赢了!";
Sleep(1000);
system("cls");
goto a2;
}
n3=n4=0;
if(m[1][2]==2&&m[1][3]==2&&m[1][1]==2
||m[2][2]==2&&m[3][3]==2&&m[1][1]==2
||m[2][1]==2&&m[3][1]==2&&m[1][1]==2)
{
n3=1;n4=1;
}
if(m[1][2]==2&&m[1][1]==2&&m[1][3]==2
||m[2][2]==2&&m[3][1]==2&&m[1][3]==2
||m[2][3]==2&&m[3][3]==2&&m[1][3]==2)
{
n3=1;n4=3;
}
if(m[3][2]==2&&m[3][3]==2&&m[3][1]==2
||m[2][2]==2&&m[1][3]==2&&m[3][1]==2
||m[2][1]==2&&m[1][1]==2&&m[3][1]==2)
{
n3=3;n4=1;
}
if(m[3][2]==2&&m[3][1]==2&&m[3][3]==2
||m[2][2]==2&&m[1][1]==2&&m[3][3]==2
||m[2][3]==2&&m[1][3]==2&&m[3][3]==2)
{
n3=3;n4=3;
}
if(m[1][3]==2&&m[1][1]==2&&m[1][2]==2
||m[2][2]==2&&m[3][2]==2&&m[1][2]==2)
{
n3=1;n4=2;
}
if(m[3][3]==2&&m[3][1]==2&&m[3][2]==2
||m[1][2]==2&&m[3][2]==2&&m[3][2]==2)
{
n3=3;n4=2;
}
if(m[2][3]==2&&m[2][1]==2&&m[2][1]==2
||m[1][2]==2&&m[3][2]==2&&m[2][1]==2)
{
n3=2;n4=1;
}
if(m[3][3]==2&&m[1][3]==2&&m[2][3]==2
||m[2][1]==2&&m[2][2]==2&&m[2][3]==2)
{
n3=2;n4=3;
}
if(m[2][1]==2&&m[2][3]==2&&m[2][2]==2
||m[3][2]==2&&m[1][2]==2&&m[2][2]==2
||m[1][1]==2&&m[3][3]==2&&m[2][2]==2
||m[3][1]==2&&m[1][3]==2&&m[2][2]==2)
n3=2;n4=2;
if(n3&&n4)
{
Sleep(1000);
system("cls");
cout<<"你输了!";
Sleep(1000);
system("cls");
goto a2;
}
}
Sleep(1000);
cout<<"平局,不错!";
Sleep(1000);
system("cls");
goto a2;
return 0;
}
我的C++游戏
(欢迎指出不足)
飞扬的小鸟(Fly-bird)
#include<bits/stdc++.h>
#include<Windows.h>
/********函数变量声明********/
#define PR_Box printf("■")
#define PR_Gold printf("★")
#define PR_Ag printf("☆")
#define PR_FBird printf("Ю")
#define PR_DBird printf("Ф")
#define PR_Land printf("┳┳┯")
#define PR_Bg_TL printf("╔")
#define PR_Bg_TR printf("╗")
#define PR_Bg_DL printf("╚")
#define PR_Bg_DR printf("╝")
#define PR_Bg_X printf("═")
#define PR_Bg_Y printf("║")
#define PR_Blank printf(" ");
int Grade = 1, C_Gold = 0, C_Ag = 0, Score = 0, Delay_time = 1000,Max_blank=9,Distance=18;
struct Birds
{
int x, y;
int condition;
};
Birds *Bird = (Birds*)malloc(sizeof(Birds));
struct Bg
{
int x, y;
int l_blank;
int reward[9];
Bg *pri;
Bg *next;
};
Bg *Bg1 = new Bg[sizeof(Bg)];
void Position(int x, int y)
{
COORD pos = { x - 1, y - 1 };
HANDLE Out = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(Out, pos);
}
void CreatBird()
{
Bird->x=41;
Bird->y=10;
Bird->condition =0;
}
void CreatBg()
{
Bg *Bg2 = (Bg*)malloc(sizeof(Bg));
Bg1->x=90;Bg1->y =8;
Bg2->x=Bg1->x+Distance;Bg2->y =9;
Bg1->l_blank =Max_blank-Grade;
Bg2->l_blank =Max_blank-Grade;
Bg1->next=Bg2;
Bg1->pri=Bg2;
Bg2->next=Bg1;
Bg2->pri=Bg1;
}
void InsertBg(Bg *p)
{int temp;
Bg *Bgs = (Bg*)malloc(sizeof(Bg));
Bgs->x=p->pri->x+Distance;
Bgs->l_blank =Max_blank-Grade;
srand((int)time(0));
temp=rand();
if(temp%2==0)//++
{ if((temp%4+p->pri->y+Max_blank-Grade)<21)
Bgs->y=p->pri->y+temp%4;
else
Bgs->y=p->pri->y;
}
else
{
if((p->pri->y-temp%4)>2)
Bgs->y=p->pri->y-temp%4;
else
Bgs->y=p->pri->y;
}
Bgs->pri=p->pri;
Bgs->next =p;
p->pri->next=Bgs;
p->pri =Bgs;
}
void Check_Bg(Bg *q)
{ Bg *p=q;int i=0,temp;
while(++i<=5)
{ if(p->x>-4)
p=p->next;
else
{ srand((int)time(0));
temp=rand();
if(temp%2==0)//++
{ if((temp%4+p->y+Max_blank-Grade)<21)
p->y=p->y+temp%4;
else
p->y=p->y;
p->x=p->pri->x+Distance;
p->l_blank=Max_blank-Grade;
}
else
{
if((p->y-temp%4)>2)
p->y=p->y-temp%4;
else
p->y=p->y;
p->x=p->pri->x+Distance;
p->l_blank=Max_blank-Grade;
}
}
}
}
void Loop_Bg(Bg *q)
{
Bg *p=q;int i=0;
while(++i<=5)
{p->x=p->x-1;
p=p->next ;
if(Bird->x==p->x)
{Score+=1;
if(Score%4==0&&Grade<4)
Grade++;
}
}
}
void Prt_Bg(Bg *q)
{ Bg *p=q;int i=0,k,j;
while(++i<=5)
{ if(p->x>0&&p->x<=78)
{ for(k=2;k<p->y;k++)
{ Position(p->x+1,k);
PR_Box;PR_Box;PR_Blank
}
Position(p->x,p->y);
PR_Box;PR_Box;PR_Box;PR_Blank;
Position(p->x,p->y+p->l_blank);
PR_Box;PR_Box;PR_Box;PR_Blank;
k=k+p->l_blank+1;
for(k;k<=22;k++)
{Position(p->x+1,k);
PR_Box;PR_Box;PR_Blank;
}
Position(p->x,23);
for(k=1;k<Distance/3-2;k++)
PR_Land;
}
p=p->next;
if(p->x==0)
{ for(j=2;j<p->y;j++)
{ Position(p->x+1,j);
PR_Blank;PR_Blank;
}
Position(p->x+1,p->y);
PR_Blank;PR_Blank;PR_Blank;
Position(p->x+1,p->y+Max_blank-Grade);
PR_Blank;PR_Blank;PR_Blank;
j=j+Max_blank-Grade+1;
for(j;j<=22;j++)
{Position(p->x+1,j);
PR_Blank;PR_Blank;
}}}}
void PrtBg()
{ int i;
Position(1,1);PR_Bg_TL;
Position(79,1);PR_Bg_TR;
Position(1,24);PR_Bg_DL;
Position(79,24);PR_Bg_DR;
for(i=3;i<=78;i+=2)
{ Position(i,1);PR_Bg_X;
Position(i,24);PR_Bg_X;
}
/*for(i=2;i<=23;i++)
{ Position(1,i);PR_Bg_Y;printf("%d",i-1);
Position(79,i);PR_Bg_Y;
}*/
}
void PrtBird()
{ Position(Bird->x,Bird->y-1);
PR_Blank;
Position(Bird->x,Bird->y);
PR_FBird;
Position(38,2);
printf("Score:%d",Score);
}
int CheckYN(Bg *q)
{ Bg *p=q;int i=0;
while(++i<=5)
{ if(Bird->y>23)
return 0;
if(Bird->x==p->x&&Bird->y<=p->y)
return 0;
if((Bird->x==p->x||Bird->x==p->x+1||Bird->x==p->x+2)&&Bird->y==p->y)
return 0;
if(Bird->x==p->x&&Bird->y>p->y+p->l_blank)
return 0;
if((Bird->x==p->x||Bird->x==p->x+1||Bird->x==p->x+2)&&Bird->y==p->y+p->l_blank)
return 0;
p=p->next;
}
return 1;
}
void Prtfirst()
{
printf("══════════════════════════════════════\n");
printf(" ■■ ■■\n");
printf(" ■■ ■■\n");
printf(" ■■ ■■\n");
printf(" ■■ ■■\n");
printf(" ■■ ■■ C++语言版 Flappy Bird\n");
printf(" ■■ ■■ 瞎搞人:侦探鼠\n");
printf(" ■■ ■■ 瞎搞日期:2019.7.3\n");
printf(" ■■ ■■ 耗时:2.46小时\n");
printf(" ■■■ ■■ 游戏说明:\n");
printf(" ■■ 1-按上箭头使鸟起飞\n");
printf(" ■■ 2-等级越高,难度越大!\n");
printf(" Ю ■■■\n");
printf("\n");
printf(" \n\n\n\n\n\n\n\n");
printf(" ┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳┳┯┳\n");
system("pause");
Position(1,1);
int i=0;
while(i++<40*25)
PR_Blank;
}
int main()
{int i=0;char ch;
Prtfirst();
PrtBg();
CreatBg();
InsertBg(Bg1);
InsertBg(Bg1);
InsertBg(Bg1);
CreatBird();
while(1)
{
if(!CheckYN(Bg1))
break;
Check_Bg(Bg1);
Prt_Bg(Bg1);
PrtBird();
Loop_Bg(Bg1);
Bird->y=Bird->y+1;
if(GetAsyncKeyState(VK_UP))
{ Position(Bird->x,Bird->y-1);
PR_Blank;
Bird->y=Bird->y-4;
}
while(i++<500);
{ Sleep(100);
}
i=0;
}
Position(38,10);
printf("Game Over!");
Position(1,25);
system("pause");
}
球球大作战(The-ball-sbig-fight)(闫立代码改进版)
#include<bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#include<windows.h>
#include<conio.h>
using namespace std;
void pass() {
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
SetConsoleCursorInfo(
GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
}
int jjda;
void ys()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),(++jjda)%15+1);
}
void gotoxy(int x,int y)
{
COORD c= {y-1,x-1};
SetConsoleCursorPosition(
GetStdHandle(STD_OUTPUT_HANDLE),c);
}
void ys(int yyin)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),yyin);
}
int oop,ool;
int ooj,oof;
int a[1000][1000]=
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},};
int i=4,j=4,k,l,o,p;
int kl=20,ow=20,fs;
int main(void)
{
system("mode con cols=111");
pass();
SetConsoleTitle("球球大作战");
for(k=0;k<100;k++)
{
for(l=0;l<100;l++)
{
if(a[k][l]==0)
{
ys();
printf(".");
}
}
}
for(;;)
{
gotoxy(1,1);
ys(10);
printf("1P的大小:%dkg\n\n",o);
gotoxy(2,1);
ys(11);
printf("2P的大小:%dkg\n\n",fs);
gotoxy(i,j);
ys(10);
printf("●");
gotoxy(kl,ow);
ys(11);
printf("●");
if(i==kl&&j==ow)
{
if(o>fs)
{
system("cls");
printf("1P Win!");
Sleep(1000);
break;
}
else
if(o<fs)
{
system("cls");
printf("2P Win!");
Sleep(1000);
break;
}
else
if(o==fs)
{
system("cls");
printf("平局!");
Sleep(1000);
break;
}
}
p=getch();
Sleep((o+fs)/20);
if(p==119)
{
i--;
gotoxy(i+1,j);
printf(" ");
if(a[i][j]==0)
{
o++;
a[i+1][j]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==115)
{
i++;
gotoxy(i-1,j);
printf(" ");
if(a[i][j]==0)
{
o++;
a[i-1][j]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==97)
{
j--;
if(a[i][j]==0)
{
o++;
a[i][j+1]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==100)
{
j++;
if(a[i][j]==0)
{
o++;
a[i][j-1]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==72)
{
kl--;
gotoxy(kl+1,ow);
printf(" ");
if(a[kl][ow]==0)
{
fs++;
a[kl+1][ow]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==80)
{
kl++;
gotoxy(kl-1,ow);
printf(" ");
if(a[kl][ow]==0)
{
fs++;
a[kl-1][ow]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==75)
{
ow--;
if(a[kl][ow]==0)
{
fs++;
a[kl][ow+1]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==77)
{
ow++;
if(a[kl][ow]==0)
{
fs++;
a[kl][ow-1]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==27)
{
break;
}
srand(time(NULL));
oop=rand()%20+1;
srand(time(NULL));
ool=rand()%20+1;
gotoxy(oop,ool);
}
}
为民除害(Carry out)
#include<bits/stdc++.h>
#include <iostream>
#include <time.h>
#include <windows.h>
using namespace std;
int hh = 0;
long long jx = 15 , fx = 8, hpx = 30 , jy = 0, gold = 0 , lv = 1 , b ,lvd,yyi,yer,ysan,ysi,hhx,dhhx;
int jpn,zt = 0 , dzt = 0 , ztx , dztx ;
string cinmmz , cinboss;
long long j = jx , f = fx, hp = hpx;
bool dhpx = false;
string name;
bool z1,z2,z3,z4,z5,z6,z7;
int slowout(char *p)
{
while(1)
{
if(*p!=0)
printf("%c",*p++);
else
break;
Sleep(70);
}
}
int so(char *o)
{
while(1)
{
if(*o!=0)
printf("%c",*o++);
else
break;
Sleep(10);
}
}
void wap(int dg , int df ,int dhp,string boss,int jyx , int goldx)
{
Sleep(900);
slowout("\n是否攻击/逃跑?(1/else)");
cin >> ysi;
zt = 0;
dzt = 0;
while(hp > 0 && dhp > 0 && ysi == 1)
{
j = jx;
f = fx;
if(jpn == 1)
{
system("cls");
cout << "\n你使用了---飞龙在天!\n";
j += 300;
system("pause");
}
dztx = 0;
ztx = 0;
system("cls");
dhpx = false;
cout << boss;
printf("剩余血量%d\n",dhp);
Sleep(800);
cout << name;
printf("剩余血量%d\n",hp);
Sleep(800);
srand(time(0));
ztx = rand() % 3 + 1;
if(ztx != 1)zt ++;
if(zt == 1)
{
cout << name << "精神振作了一点,状态增加一级!\n";
j += 2;
}
if(zt == 2)
{
cout << name << "燃起斗志了,状态增加二级!\n";
j += 3;
}
if(zt == 3)
{
if(hhx > 1)
{
srand(time(0));
ztx = rand()%3+1;
if(ztx == 1)
{
cout << name << "恢复正常了,状态增加零!\n";
j = jx;
hhx = 0;
}
}
else
{
cout << name << "进入暴走状态,火力全开!!!\n";
j += 4;
hhx ++;
}
}
cout << name << "向" << boss << "攻击!\n";
if(j>=df)
{
dhp -= j - df;
cout<<boss;
printf("扣了%d滴血\n",j-df);
}
else
{
dhp-=0;
cout<<boss;
printf("扣了0滴血");
}
if(dhp <= 0)
{
printf("你打败了");
cout << boss;
printf("!\n");
jy += jyx;
gold += goldx;
dhpx = true;
system("pause");
}
else
{
srand(time(0));
dztx = rand() % 3 + 1;
if(dztx != 1)dzt ++;
if(dzt == 1)
{
cout << boss << "精神振作了一点,状态增加一级!\n";
dg += 2;
}
if(dzt == 2)
{
cout << boss << "燃起斗志了,状态增加二级!\n";
dg += 3;
}
if(dzt == 3)
{
if(dhhx > 1)
{
srand(time(0));
dztx = rand()%3+1;
if(dztx == 1)
{
cout << boss << "恢复正常了,状态增加零!\n";
dg = jx;
dhhx = 0;
}
}
else
{
cout << boss << "进入暴走状态,火力全开!!!\n";
dg += 4;
dhhx ++;
}
}
cout << boss;
printf("向你的");
cout << name << "扑来!\n";
hp -= dg - f;
cout << "你的" << name;
printf("扣了%d滴血\n",dg-f);
system("pause");
if(hp <= 0)
{
slowout("凉凉...\n");
hp = hpx;
system("pause");
return;
}
}
}
}
void gameover()
{
slowout("你打败了狼人,成为了狗国的英雄。");
slowout("你的事迹也成为了一代传奇...\n");
}
/*void senlinchuanshuo()
{
system("cls");
system("color 79");
cout<<"你要查看什么?\n";
cout<<"1.茶杯犬 2.小金毛 3.大金毛 4.藏獒 5.老虎 6.小象\n7.大象 8.霸王龙 9.灭霸\n";
int shuru;
cin>>shuru;
switch(shuru)
{
case 1:
}
}*/
int main()
{
system("color 07");
bool kg = false;
shurumokuai:
int huida=MessageBox(NULL,"请不要尝试输入任何乱码,否则将导致游戏崩溃!","提示",MB_YESNO);
if(huida==IDYES)
MessageBox(NULL,"谢谢配合!","提示",MB_OK);
else
goto shurumokuai;
so("\n\n\n\n\n\n\n----------------------------------为民除害 --------------------------------\n\n\n\n\n\n\n");
for(int i = 1; i <= 10; i++)
{
system("color 4F");
system("color 5B");
system("color 6C");
system("color 3D");
system("color 66");
}
slowout("浏阳艺校1802张浩天制作\n\n\n\n");
system("cls");
xuanzemokuai:
slowout("你正走着,看见了一只流浪狗,是否捡起?\n");
huida=MessageBox(NULL,"是否捡起","请选择",MB_YESNO);
if(huida==IDYES)
MessageBox(NULL,"你是个善良的人!","提示",MB_OK);
else
{
slowout("你没有捡起它,而是向一旁走去...\n");
goto xuanzemokuai;
}
slowout("给它取个名字:");
getline(cin,name);
if(hh != 0)goto a;
else if(hh==0)
{
cout<<"游戏开始了!";
Sleep(2000);
system("color 8F");
system("cls");
slowout("狗国有一位杀人无数的罪犯——狼人\n");
slowout("传说他杀人不眨眼,最爱收集血液\n");
slowout("知道了这些,你决定为民除害!!!\n");
system("pause");
system("cls");
cout<<"提示:\n";
if(lv == 1)slowout("在你达到三级之前在森林里攻击茶杯犬和小金毛和小象,千万不要攻击其他!\n");
if(hp < 10000)slowout("千万别攻击霸王龙!\n");
if(hp < 40000)slowout("你打不过灭霸!\n");
slowout("狼人住在邪恶之堡中\n");
system("pause");
goto a;
}
a3:
cout<<"你想要";
cout<<"改成什么名字?\n";
cin >> name;
slowout("改名成功!");
r:
hh++;
system("cls");
system("cls");
cout << "\n技能伤害:" << j << "\n防御:" << f << "\n最大生命值:" << hp << "\n等级:" << lv << " 还差" << lv * 50 - jy << "经验升级" << "\n¥:" << gold << endl;
/*
技能伤害 j
防御 f
最大生命值 hp
等级 lv
经验 jy
钱 gold
*/
system("pause");
a:
hh++;
int i;
for(i = 0; lv * 50 - jy <= 0; i++)
{
lv += 1;
jx += lv * 8;
hpx += lv * 10;
fx += lv * 6;
gold += lv * 15;
jy -= lv * 50;
}
if(i > 0)
{
cout<<"你升了";
cout << i;
cout<<"级!";
Sleep(500);
}
j = jx;
f = fx;
hp = hpx;
system("cls");
cout<<"你要干什么?\n";
cout<<"1.去森林(试炼场) 2.去商店 3.查看属性 4.重命名\n5.修炼开挂神技 6.前往邪恶之堡 7.查看提示";
int a;
cin >> a;
if(a == 1)goto b;
if(a == 2)goto c;
if(a == 3)goto r;
if(a == 4)goto a3;
if(a == 5)
{
if(kg == true)
{
slowout("您已修炼开挂神技!\n");
goto a;
}
slowout("修炼特权:\n");
cout << "1.高伤害\n";
cout << "2.高血量\n";
cout << "3.高防御\n";
cout << "4.超多金币\n";
cout << "5.获得技能 ———飞龙在天!\n";
system("pause");
slowout("请输入密码:");
cin >> cinmmz;
if(cinmmz == "拒绝外挂")
{
hpx = 20000;
gold = 1000000;
hp = hpx;
jx += 5000;
fx += 4000;
j = jx;
f = fx;
jy += 15000;
kg = true;
jpn ++;
for(int i = 1; i <= 10; i++)
{
system("color 18");
system("color 29");
system("color 31");
system("color 42");
system("color 53");
system("color 64");
system("color 7B");
system("color 9E");
}
slowout("修炼成功!\n");
system("pause");
goto a;
}
else
{
slowout("错误!");
goto a;
}
}
if(a == 6)goto BOSS;
if(a == 7)
{
if(lv == 1)slowout("在森林里攻击茶杯犬和小金毛和小象,千万不要攻击其他!\n");
if(kg == true)slowout("别以为开挂了就谁都打得过了!\n");
if(hp < 10000)slowout("千万别攻击霸王龙!\n");
if(hp < 40000)slowout("你打不过灭霸!\n");
system("pause");
goto a;
}
if(a != 1 && a != 2 && a != 3 && a != 4 && a != 5 && a != 6 && a != 7&&a!=8 )
goto x;
b:
int pp;
srand((unsigned)time(NULL));
if(j>=150)
pp=5+rand()%13;
else if(j<=150)
pp = 1+rand()%5;
if(pp == 1)
{
cout << "你遇到了一只茶杯犬!(危险度:0级)";
wap(10,5,20,"茶杯犬",100,20);
goto a;
}
if(pp == 2)
{
cout << "你遇到了一只小金毛!(危险度:0.5级)";
wap(20,15,40,"小金毛",150,35);
goto a;
}
if(pp == 3)
{
cout << "你遇到了一只大金毛!(危险度:1级)";
wap(40,20,100,"大金毛",350,80);
goto a;
}
if(pp == 4)
{
cout << "你遇到了一只藏獒!(危险度:2级)";
wap(70,50,250,"藏獒",700,100);
goto a;
}
if(pp == 5)
{
cout << "你遇到了一只老虎!(危险度:3级!)";
wap(150,200,500,"老虎",1000,120);
goto a;
}
if(pp > 5 && pp < 10)
{
cout << "你遇到了一只小象!(危险度:2.5级)";
wap(100,180,25,"小象",1500,150);
goto a;
}
if(pp == 10)
{
cout << "你遇到了一只大象!(危险度:4级!!)";
wap(200,190,1000,"大象",2000,200);
goto a;
}
if(pp == 11)
{
cout << "你遇到了一只霸王龙!(危险度:6级!!!)";
wap(2000,2000,10000,"霸王龙",3000,300);
goto a;
}
if(pp == 12)
{
cout << "你遇到了一只灭霸!(危险度:无法测量!!!!!!!!!)";
wap(10000,15000,40000,"灭霸",4000,900);
goto a;
}
c:
system("cls");
Sleep(800);
slowout("你要买什么?\n");
cout <<"1.木剑(攻击+4)20¥\n\n2.石剑(攻击+5)30¥\n\n3.铁剑(攻击+6)40¥\n\n4.金剑(攻击+4)50¥\n\n5.钻石剑(攻击+7)60¥\n\n6.技能 --- 飞龙在天150¥ \n\n7.40米大刀(攻击加500)300¥\n\n0.退出\n\n";
cout<<"你有"<<gold<<"元钱";
cin >> b;
if(b == 1)
{
if(gold < 20)
slowout("买不起!\n");
if(z1)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 20;
jx += 4 ;
j=jx;
z1=true;
}
system("pause");
goto c;
}
if(b == 2)
{
if(gold < 30)
slowout("买不起!\n");
if(z2)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 30;
jx += 5 ;
j=jx;
z2=true;
}
system("pause");
goto c;
}
if(b == 3)
{
if(gold < 40)
slowout("买不起!\n");
if(z3)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 40;
jx += 6 ;
j=jx;
z3=true;
}
system("pause");
goto c;
}
if(b == 4)
{
if(gold < 50)
slowout("买不起!\n");
if(z4)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 50;
jx += 4 ;
j=jx;
z4=true;
}
system("pause");
goto c;
}
if(b == 5)
{
if(gold < 60)
slowout("买不起!\n");
if(z5)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 60;
jx += 7;
j=jx;
z5=true;
}
system("pause");
goto c;
}
if(b == 6)
{
if(gold < 150)
slowout("买不起!\n");
if(z6)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 150;
jpn =1;
z6=true;
}
system("pause");
goto c;
}
if(b==7)
{
if(gold<300)
slowout("买不起\n");
if(z7)
{
slowout("你买过了");
cout<<endl;
}
else
{
slowout("购买成功!\n");
gold -= 300;
jx+=500;
j=jx;
z7=true;
}
system("pause");
goto c;
}
if(b == 0)
goto a;
if(b != 0&&b != 1&&b != 2&&b != 3&&b != 4&&b != 5&&b != 6&&b!=7)
goto x;
x:
slowout("输入错误!");
Sleep(500);
goto a;
BOSS:
slowout("确定吗?(1/2)");
cin >> ysan;
if(ysan == 2) goto a;
if(ysan != 2 && ysan != 1) goto x;
system("cls");
slowout("你进入了邪恶之堡。突然,你身后大门竟然自己关上了\n");
slowout("周围一片阴森,四处布满危机,你听到有人来了!!!\n");
Sleep(500);
slowout("狼崽子守卫向你扑来!\n");
wap(2000,1000,10000,"狼崽子守卫",1000,2000);
if(dhpx == false || ysi != 1)goto a;
slowout("你打败了狼崽子守卫,继续前进。\n");
slowout("虽然首战告捷,但是你知道,真正的敌人远远不止如此,你更加警惕了!!!\n");
Sleep(500);
slowout("母狼巡警向你扑来!\n");
wap(2500,2000,10000,"母狼巡警",2000,4000);
if(dhpx == false || ysi != 1)goto a;
slowout("你打败了母狼巡警,继续往前探索。\n");
slowout ("你来到了邪恶之堡的顶层,如果线索正确的话,狼人应该就在里面!!!\n");
Sleep(500);
slowout("狼人的贴身保镖向你扑来!\n");
wap(4000,3000,20000,"狼人的贴身保镖",3000,7000);
if(dhpx == false || ysi != 1)goto a;
slowout("你打败了狼人的贴身保镖,来到了邪恶之堡的最深处\n");
Sleep(500);
gameover2:
if(kg==true)
{
cout<<"你竟然修炼了外挂神技!!!"<<endl;
slowout("狼人服下暴血丸状态大增") ;
wap(40000,6000,1000000,"狼人",100000000,100000000);
}
printf("狼人向你的");
cout << name;
printf("扑来!\n");
Sleep(800);
if(hp<=1000)
{
cout << "你的" << name << "还剩1丝血\n";
slowout("突然,你的宠物感觉到一股力量由你传来\n");
Sleep(800);
slowout("它进化成了中华田园犬!\n");
j += 10000;
jx=j;
f += 10000;
fx=f;
hp += 10000;
wap(10000,6000,100000,"狼人",100000000,100000000);
}
if(dhpx == false || ysi != 1)goto a;
else gameover();
return 0;
}
大炮发射(2019.11.8测试超多BUG版)【Artillery fire (2019.11.8 test super bugs more)】
#include<bits/stdc++.h>//打方块 Windows7
#include<windows.h>
using namespace std;
int fen,mb[10][18],leaf;
void kg(int a)
{
for(int i=0;i<a;i++)
cout<<' ';
}
void go(int x, int y)
{
COORD p;
p.X=(x-1)*2;
p.Y=y-1;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),p);
}
void printtu(int x,int y,bool a)
{
go(x,y);
cout<<"□";
if(x>2&&x<11)
{
go(x-1,y+1);
cout<<"□□□";
}
else if(x==2)
{
go(x,y+1);
cout<<"□□";
}
else if(x==11)
{
go(x-1,y+1);
cout<<"□□";
}
else;
if(a)
for(int i=0;i<18;i++)
{
go(2,i+2);
kg(20);
}
Sleep(100);
go(x,y);
kg(2);
if(x>2&&x<11)
{
go(x-1,y+1);
kg(6);
}
else if(x==2)
{
go(x,y+1);
kg(4);
}
else if(x==11)
{
go(x-1,y+1);
kg(4);
}
else;
go(14,5);
kg(4);
cout<<"\b\b\b\b"<<fen;
if(a)
for(int i=0;i<18;i++)
{
go(2,i+2);
for(int o=0;o<10;o++)
{
if(mb[o][i])
cout<<"■";
else kg(2);
}
}
}
void sj(int x)
{
int i;
for(i=19;;i--)
{
go(x,i);
cout<<"■";
Sleep(10);
cout<<"\b\b";
kg(2);
if(i<3)break;
if(mb[x-2][i-3]==1)break;
}
mb[x-2][i-2]=1;
go(x,i);
cout<<"■";
fen-=10;
for(int o=0;o<10;o++)
if(mb[o][i-2]==0)return;
for(int o=0;o<10;o++)
mb[o][i-2]=0;
for(int o=i-2;o<17;o++)
for(int j=0;j<10;j++)
mb[j][o]=mb[j][o+1];
for(int o=0;o<10;o++)
mb[o][17]=0;
printtu(x,20,1);
fen+=100;
}
void mouse(int &x,int &y)
{
POINT p;
HWND h=GetForegroundWindow();
GetCursorPos(&p);
ScreenToClient(h,&p);
x=p.x;
y=p.y;
}
void m(int wt)
{
lkr:;
fen=-500;
leaf=8;
srand(time(0));
system("mode con cols=33 lines=24");
system("cls");
cout<<"┌┄┄┄┄┄┄┄┄┄┄┐"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆ 分数"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆ 生命"<<endl;
cout<<"┆";kg(20);cout<<"┆";printf("%c %c %c %c\n",3,3,3,3);
cout<<"┆";kg(20);cout<<"┆";printf("%c %c %c %c\n",3,3,3,3);
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"┆";kg(20);cout<<"┆"<<endl;
cout<<"└┄┄┄┄┄┄┄┄┄┄┘"<<endl;
lk:;
for(int i=0;i<10;i++)
for(int o=0;o<18;o++)
mb[i][o]=0;
int x=6;
for(int i=wt*10;;)
{
if(i<wt*10)goto asd;
for(int i=0;i<10;i++)
for(int o=0;o<18;o++)
if(mb[i][o]!=0)goto qwe;
fen+=500;
qwe:;
for(int o=0;o<10;o++)
if(mb[o][17]==1)goto as;
for(int o=17;o>0;o--)
for(int j=0;j<10;j++)
mb[j][o]=mb[j][o-1];
for(int o=0;o<10;o++)
mb[o][0]=rand()%2;
asd:;
if(GetAsyncKeyState(VK_RIGHT)!=0&&x<11)x++;
if(GetAsyncKeyState(VK_LEFT)!=0&&x>2)x--;
if(GetAsyncKeyState(VK_UP)!=0)sj(x);
printtu(x,20,i>=wt*10);
if(i<wt*10)i++;
else i=1;
}
as:;
for(int i=2;i<22;i++)
{
go(2,i);
kg(20);
}
fen-=600;
switch(leaf)
{
case 1:
go(13,8);
cout<<' '<<' ';
break;
case 2:
leaf--;
go(14,8);
cout<<' '<<' ';
goto lk;
case 3:
leaf--;
go(15,8);
cout<<' '<<' ';
goto lk;
case 4:
leaf--;
go(16,8);
cout<<' '<<' ';
goto lk;
case 5:
leaf--;
go(13,9);
cout<<' '<<' ';
goto lk;
case 6:
leaf--;
go(14,9);
cout<<' '<<' ';
goto lk;
case 7:
leaf--;
go(15,9);
cout<<' '<<' ';
goto lk;
case 8:
leaf--;
go(16,9);
cout<<' '<<' ';
goto lk;
}
go(5,7);
cout<<"你输了!";
go(3,9);
cout<<"┌┄┄┐┌┄┄┐";
go(3,10);
cout<<"┆再来┆┆返回┆";
go(3,11);
cout<<"└┄┄┘└┄┄┘";
for(;;)
{
int x1,x2;
mouse(x1,x2);
if(x1<88&&x1>40&&x2<168&&x2>135&&GetAsyncKeyState(VK_LBUTTON)!=0)goto lkr;
if(x1<145&&x1>96&&x2<168&&x2>135&&GetAsyncKeyState(VK_LBUTTON)!=0)return;
}
}
void dafangkuai(){}
int main()
{
int q=3;
// "调英文!调英文!调英文!\n不然会后悔"
a:;
system("mode con cols=80 lines=25");
system("cls");
bool jh[8][27]={0,0,1,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,1,0,0,1,1,1,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0};
for(int i=2;i<10;i++)
{
go(7,i);
for(int o=0;o<27;o++)
{
if(jh[i-2][o])
cout<<"■";
else cout<<' '<<' ';
}
}
go(17,11);
cout<<"|开始游戏|";
go(17,13);
cout<<"|设置游戏|";
go(17,15);
cout<<"|游戏规则|";
go(17,17);
cout<<"|退出游戏|";
go(1,23);
cout<<"[L]确定";
int y=1;
for(;;)
{
if(GetAsyncKeyState(VK_DOWN)!=0)y+=((y==4)?-3:1);
if(GetAsyncKeyState(VK_UP)!=0)y-=((y==1)?-3:1);
if(GetAsyncKeyState('l')!=0||GetAsyncKeyState('L')!=0)
switch(y)
{
case 1:
system("cls");
m(q);
goto a;
case 2:
system("cls");
go(16,11);
cout<<' '<<q<<"秒增加一行";
go(16,10);
printf(" %c",30);
go(16,12);
printf(" %c",31);
go(1,23);
cout<<"[K]确定";
for(;;)
{
int x,y;
mouse(x,y);
if(x<255&&x>247&&y<155&&y>145&&GetAsyncKeyState(VK_LBUTTON)!=0&&q<9)
{
q++;
go(16,11);
cout<<' '<<q;
}
if(x<255&&x>247&&y<190&&y>180&&GetAsyncKeyState(VK_LBUTTON)!=0&&q>1)
{
q--;
go(16,11);
cout<<' '<<q;
}
if(GetAsyncKeyState('k')!=0||GetAsyncKeyState('K')!=0)goto a;
Sleep(100);
}
case 3:
// "点确定浏览规则"
// "←→控制炮台"
// "满一行即消除"
// "每消除一行+100"
// "少一条命-100"
// "全部消除+500"
// "发射一炮-10"
case 4:
return 0;
}
go(16,11);
cout<<' '<<' ';
go(22,11);
cout<<' ';
go(16,13);
cout<<' '<<' ';
go(22,13);
cout<<' ';
go(16,15);
cout<<' '<<' ';
go(22,15);
cout<<' ';
go(16,17);
cout<<' '<<' ';
go(22,17);
cout<<' ';
go(16,9+2*y);
cout<<' '<<'>';
go(22,9+2*y);
cout<<'<';
Sleep(100);
}
}
狼人杀
#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<windows.h>
using namespace std;
struct IDname
{
int geshu;
string NAME;
};
IDname jue_se[100];
struct ID
{
int num;
bool life;
string name;
int know;
int how;
};
ID player[21];
int n,MY,kill1,kill2;
char a;
bool jieyao=1,duyao=1;
int lieren,shouwei=0;
void init1()
{
jue_se[1].NAME="村民 ";
jue_se[2].NAME="狼人 ";
jue_se[3].NAME="女巫 ";
jue_se[4].NAME="预言家 ";
jue_se[5].NAME="猎人 ";
jue_se[6].NAME="守卫 ";
}
void init2(int nn)
{
switch(nn)
{
case 6:
jue_se[1].geshu=3;
jue_se[2].geshu=2;
jue_se[3].geshu=1;
jue_se[4].geshu=0;
jue_se[5].geshu=0;
jue_se[6].geshu=0;
break;
case 7:
jue_se[1].geshu=3;
jue_se[2].geshu=2;
jue_se[3].geshu=1;
jue_se[4].geshu=1;
jue_se[5].geshu=0;
jue_se[6].geshu=0;
break;
case 8:
jue_se[1].geshu=3;
jue_se[2].geshu=3;
jue_se[3].geshu=1;
jue_se[4].geshu=1;
jue_se[5].geshu=0;
jue_se[6].geshu=0;
break;
case 9:
jue_se[1].geshu=3;
jue_se[2].geshu=3;
jue_se[3].geshu=1;
jue_se[4].geshu=1;
jue_se[5].geshu=1;
jue_se[6].geshu=0;
break;
case 10:
jue_se[1].geshu=4;
jue_se[2].geshu=3;
jue_se[3].geshu=1;
jue_se[4].geshu=1;
jue_se[5].geshu=1;
jue_se[6].geshu=0;
break;
case 11:
jue_se[1].geshu=4;
jue_se[2].geshu=4;
jue_se[3].geshu=1;
jue_se[4].geshu=1;
jue_se[5].geshu=1;
jue_se[6].geshu=0;
break;
case 12:
jue_se[1].geshu=4;
jue_se[2].geshu=4;
jue_se[3].geshu=1;
jue_se[4].geshu=1;
jue_se[5].geshu=1;
jue_se[6].geshu=1;
break;
default:
cout<<"输入错误,再见"<<endl;
exit(0);
break;
}
}
int van[10]={7,4,6,43,35,1,2,8,20,19};
void init3(int nn)
{
srand(time(0));
Sleep(rand()%44);
int x=10000;
int t=rand();
srand(time(NULL));
int y=van[(rand()%100*van[rand()%10]+t)%10];
if(nn<=6)
x=abs(x*6/y)%3+1;
else if(nn<=8)
x=abs(x*7/y)%4+1;
else if(nn<=11)
x=abs(x*8/y)%5+1;
else if(nn<=14)
x=abs(x*9/y)%6+1;
do
{
if(nn<=6)
x=x%3+1;
else if(nn<=8)
x=x%4+1;
else if(nn<=11)
x=x%5+1;
else if(nn<=14)
x=x%6+1;
if(jue_se[x].geshu>0)
{
player[nn].name=jue_se[x].NAME;
if(player[nn].name=="猎人 ")
lieren=nn;
if(player[nn].name=="守卫 ")
shouwei=nn;
player[nn].life=1;
player[nn].num=nn;
player[nn].know=0;
jue_se[x].geshu--;
player[nn].how=0;
break;
}
}
while(jue_se[x].geshu==0);
}
void printhhh()
{
int cm=0;
int sz=0;
for(int i=1;i<=n;i++)
{
if(player[i].life==0)
continue;
else if(player[i].name=="村民 ")
cm++;
else if(player[i].name=="女巫 "||player[i].name=="预言家 "||player[i].name=="猎人 "||player[i].name=="守卫 ")
sz++;
}
if(sz==0||cm==0)
cout<<"狼人阵营胜利"<<endl;
else
cout<<"好人阵营胜利"<<endl;
for(int i=1;i<=n;i++)
{
cout<<left<<setw(3)<<player[i].num<<": "<<player[i].name<<" ";
if(player[i].life==0)
cout<<"死亡"<<"\t";
else
cout<<"存活"<<"\t";
if(player[i].how==0)
cout<<"最终存活 "<<endl;
else if(player[i].how==1)
cout<<"最终被狼人杀死"<<endl;
else if(player[i].how==2)
cout<<"最终被投票投死"<<endl;
else if(player[i].how==3)
cout<<"最终被女巫毒死"<<endl;
else if(player[i].how==4)
cout<<"最终被猎人射杀"<<endl;
}
system("pause");
system("pause");
system("pause");
}
void print(int day,int ti)
{
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY);
else
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<"\t\t\t\t第"<<day<<"天 ";
if(ti==0)
cout<<"白天"<<endl;
else
cout<<"夜晚"<<endl;
cout<<"我的位置:"<<MY<<"号"<<endl;
for(int i=1;i<=6;i++)
{
cout<<player[i].num<<"号位 ";
}
cout<<endl;
for(int i=1;i<=6;i++)
{
if(player[i].life==1)
{
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY | FOREGROUND_GREEN);
else
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_GREEN);
cout<<"存活 ";
}
else
{
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY | FOREGROUND_RED);
else
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
cout<<"已死亡 ";
}
}
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY);
else
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<endl;
for(int i=1;i<=6;i++)
{
if(player[i].know==0)
cout<<"未知 ";
else if(player[i].know==1)
{
if(player[i].name=="狼人 ")
cout<<"狼人 ";
else
cout<<"好人 ";
}
else if(player[i].know==2)
cout<<player[i].name<<" ";
}
cout<<endl<<endl;
for(int i=7;i<=n;i++)
{
if(i<10)
cout<<player[i].num<<"号位 ";
else
cout<<player[i].num<<"号位 ";
}
cout<<endl;
for(int i=7;i<=n;i++)
{
if(player[i].life==1)
{
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY | FOREGROUND_GREEN);
else
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_GREEN);
cout<<"存活 ";
}
else
{
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY | FOREGROUND_RED);
else
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
cout<<"已死亡 ";
}
}
if(ti==0)
SetConsoleTextAttribute(handle,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|FOREGROUND_INTENSITY);
else
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<endl;
for(int i=7;i<=n;i++)
{
if(player[i].know==0)
cout<<"未知 ";
else if(player[i].know==1)
{
if(player[i].name=="狼人 ")
cout<<"狼人 ";
else
cout<<"好人 ";
}
else if(player[i].know==2)
cout<<player[i].name<<" ";
}
cout<<endl<<endl;
}
int shou=0;
void shoushui(int hhh,int hhhh)
{
int x;
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"守~卫~请~睁~眼~~~"<<endl;
Sleep(3000);
system("cls");
print(hhh,hhhh);
if(MY==shouwei&&player[MY].life==1)
{
cout<<"请问你要守护谁?"<<endl<<"输入:";
cin>>x;
while(x==shou||x<1||x>n||player[x].life==0)
{
cout<<"输入错误,请重新输入"<<endl<<"输入:";
cin>>x;
}
shou=x;
}
else if(player[shouwei].life==1)
{
cout<<"请问你要守护谁?"<<endl;
Sleep(rand()%98);
srand(time(0));
x=rand()%n+1;
while(x==shou||player[x].life==0)
{
Sleep(rand()%98);
srand(time(0));
x=rand()%n+1;
}
shou=x;
}
else
{
cout<<"请问你要守护谁?"<<endl;
Sleep(3000);
shou=-1;
}
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"守~卫~请~闭~眼~~~"<<endl;
}
struct tou
{
int xxx;
int num;
int toupiaoquan;
};
tou TOU[13];
bool cmp(tou x,tou y)
{
if(x.xxx==y.xxx)
return x.num<y.num;
return x.xxx>y.xxx;
}
bool cmp1(tou x,tou y)
{
return x.num<y.num;
}
void toupiao(int ddd,int nnn)
{
//--------1--------
int x;
Sleep(2000);
system("cls");
print(ddd,nnn);
cout<<"现在大家请投票";
for(int i=1;i<=3;i++)
{
cout<<".";
Sleep(500);
}
cout<<endl;
for(int i=1;i<=n;i++)
{
TOU[i].num=i;
TOU[i].toupiaoquan=1;
TOU[i].xxx=0;
}
for(int i=1;i<=n;i++)
{
if(player[i].life==1)
{
Sleep(3000);
if(i==MY)
{
cout<<"请投票...(0弃权)"<<endl;
cin>>x;
while(player[x].life==0&&x!=0)
{
cin>>x;
}
if(x==0)
cout<<MY<<"号玩家弃权"<<endl;
else
cout<<MY<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else
{
srand(time(0));
if(player[i].name=="狼人 ")
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||player[x].name=="狼人 "||x==i))
{
Sleep(rand()%98);
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else if(player[i].name=="预言家 ")
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||player[x].name!="狼人 "||x==i))
{
Sleep(rand()%98);
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||x==i))
{
Sleep(rand()%98);
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
}
if(x!=0)
TOU[x].xxx++;
}
}
Sleep(3000);
sort(TOU+1,TOU+n+1,cmp);
if(TOU[2].xxx!=TOU[1].xxx)
{
cout<<"投票结束,"<<TOU[1].num<<"号投票出局"<<endl;
player[TOU[1].num].life=0;
player[TOU[1].num].how=2;
Sleep(3000);
return;
}
else
{
TOU[1].toupiaoquan=0;
TOU[2].toupiaoquan=0;
system("cls");
print(ddd,nnn);
cout<<TOU[1].num<<"号,"<<TOU[2].num<<"号";
int i;
for(i=3;i<=n;i++)
{
if(TOU[i].xxx==TOU[1].xxx)
{
TOU[i].toupiaoquan=0;
cout<<","<<TOU[i].num<<"号";
}
else
break;
}
if(i==n+1)
{
for(int i=1;i<=n;i++)
TOU[i].toupiaoquan=1;
}
cout<<"平票"<<endl;
}
//--------2--------
sort(TOU+1,TOU+n+1,cmp1);
cout<<"请再次投票";
for(int i=1;i<=3;i++)
{
cout<<".";
Sleep(500);
}
cout<<endl;
for(int i=1;i<=n;i++)
{
if(player[i].life==1&&TOU[i].toupiaoquan==1)
{
Sleep(3000);
if(i==MY)
{
cout<<"请投票...(0弃权)"<<endl;
cin>>x;
while((player[x].life==0||TOU[x].toupiaoquan==1)&&x!=0)
{
cin>>x;
}
if(x==0)
cout<<MY<<"号玩家弃权"<<endl;
else
cout<<MY<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else
{
srand(time(0));
if(player[i].name=="狼人 ")
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||player[x].name=="狼人 "||x==i||TOU[x].toupiaoquan==1))
{
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else if(player[i].name=="预言家 ")
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||player[x].name!="狼人 "||x==i||TOU[x].toupiaoquan==1))
{
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||x==i||TOU[x].toupiaoquan==1))
{
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
}
if(x!=0&&TOU[i].toupiaoquan==1)
TOU[x].xxx++;
}
}
Sleep(3000);
sort(TOU+1,TOU+n+1,cmp);
if(TOU[2].xxx!=TOU[1].xxx)
{
cout<<"投票结束,"<<TOU[1].num<<"号投票出局"<<endl;
player[TOU[1].num].life=0;
player[TOU[1].num].how=2;
Sleep(3000);
return;
}
else
{
TOU[1].toupiaoquan=0;
TOU[2].toupiaoquan=0;
system("cls");
print(ddd,nnn);
cout<<TOU[1].num<<"号,"<<TOU[2].num<<"号";
int i;
for(i=3;i<=n;i++)
{
if(TOU[i].xxx==TOU[1].xxx)
{
TOU[i].toupiaoquan=0;
cout<<","<<TOU[i].num<<"号";
}
else
break;
}
if(i==n+1)
{
for(int i=1;i<=n;i++)
TOU[i].toupiaoquan=1;
}
cout<<"平票"<<endl;
}
//--------3--------
sort(TOU+1,TOU+n+1,cmp1);
cout<<"请再次投票";
for(int i=1;i<=3;i++)
{
cout<<".";
Sleep(500);
}
cout<<endl;
for(int i=1;i<=n;i++)
{
if(player[i].life==1&&TOU[i].toupiaoquan==1)
{
Sleep(3000);
if(i==MY)
{
cout<<"请投票...(0弃权)"<<endl;
cin>>x;
while((player[x].life==0||TOU[x].toupiaoquan==1)&&x!=0)
{
cin>>x;
}
if(x==0)
cout<<MY<<"号玩家弃权"<<endl;
else
cout<<MY<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else
{
srand(time(0));
if(player[i].name=="狼人 ")
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||player[x].name=="狼人 "||x==i||TOU[x].toupiaoquan==1))
{
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else if(player[i].name=="预言家 "||player[i].name=="猎人 ")
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||player[x].name!="狼人 "||x==i||TOU[x].toupiaoquan==1))
{
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
else
{
x=rand()%(n+1);
while(x!=0&&(player[x].life==0||x==i||TOU[x].toupiaoquan==1))
{
srand(time(0));
x=rand()%(n+1);
}
if(x==0)
cout<<i<<"号玩家弃权"<<endl;
else
cout<<i<<"号玩家投给了"<<x<<"号玩家"<<endl;
}
}
if(x!=0&&TOU[i].toupiaoquan==1)
TOU[x].xxx++;
}
}
Sleep(3000);
sort(TOU+1,TOU+n+1,cmp);
if(TOU[2].xxx!=TOU[1].xxx)
{
cout<<"投票结束,"<<TOU[1].num<<"号投票出局"<<endl;
player[TOU[1].num].life=0;
player[TOU[1].num].how=2;
}
else
{
cout<<"投票结束,无人出局"<<endl;
}
Sleep(5000);
}
bool game_over()
{
int pingmin=0;
int langren=0;
int shenzhi=0;
for(int i=1;i<=n;i++)
{
if(player[i].life==0)
continue;
if(player[i].name=="狼人 ")
langren++;
else if(player[i].name=="村民 ")
pingmin++;
else if(player[i].name=="女巫 "||player[i].name=="预言家 "||player[i].name=="猎人 ")
shenzhi++;
}
if(shenzhi==0||langren==0||pingmin==0)
return 1;
return 0;
}
void night()
{
system("cls");
system("color 0f");
print(1,1);
cout<<"天~黑~请~闭~眼~~~"<<endl;
if(n>=12)
shoushui(1,1);
Sleep(3000);
system("cls");
print(1,1);
cout<<"狼~人~请~睁~眼~~~"<<endl;
if(player[MY].name=="狼人 ")
{
Sleep(1000);
cout<<"你的同伴有:";
for(int i=1;i<=n;i++)
{
if(i==MY)
continue;
if(player[i].name=="狼人 ")
{
cout<<player[i].num<<"号 ";
player[i].know=2;
}
}
Sleep(3000);
cout<<endl<<"请问你们要杀谁:"<<endl<<"输入:";
cin>>kill1;
Sleep(1500);
system("cls");
print(1,1);
cout<<"今晚你们要杀的是"<<kill1<<"号玩家"<<endl;
}
else
{
Sleep(4000);
system("cls");
print(1,1);
cout<<"请问你们要杀谁?"<<endl;
do
{
Sleep(rand()%18);
srand(time(0));
int x=rand()%n+1;
if(player[x].name!="狼人 "&&player[x].life==1)
{
kill1=x;
break;
}
}
while(1);
Sleep(5000);
}
Sleep(3000);
system("cls");
print(1,1);
cout<<"狼~人~请~闭~眼~~~"<<endl;
Sleep(2000);
system("cls");
print(1,1);
cout<<"女~巫~请~睁~眼~~~"<<endl;
Sleep(2000);
system("cls");
print(1,1);
if(player[MY].name=="女巫 "&&player[MY].life==1)
{
Sleep(1000);
if(jieyao==1)
{
cout<<"今晚"<<kill1<<"号玩家被杀"<<endl;
Sleep(500);
cout<<"请问你要救吗???"<<endl<<"A. 救 B.不救"<<endl<<"输入:";
cin>>a;
if(a=='A')
{
system("cls");
print(1,1);
cout<<"请问你要毒吗???"<<endl;
Sleep(2000);
system("cls");
print(1,1);
cout<<"今晚"<<kill1<<"号玩家被你解救"<<endl;
jieyao=0;
if(shou!=kill1)
kill1=0;
}
else
{
if(shou==kill1)
kill1=0;
Sleep(2000);
system("cls");
print(1,1);
cout<<"请问你要毒吗???"<<endl<<"A. 毒 B.不毒"<<endl<<"输入:";
cin>>a;
if(a=='A')
{
cout<<"请问你要毒谁???"<<endl<<"输入:";
cin>>kill2;
while(player[kill2].life!=1)
{
cout<<"输入错误,请重新输入:"<<endl;
cin>>kill2;
}
duyao=0;
}
}
}
else
{
if(shou==kill1)
kill1=0;
Sleep(2000);
system("cls");
print(1,1);
cout<<"请问你要毒吗???"<<endl<<"A. 毒 B.不毒"<<endl<<"输入:";
cin>>a;
if(a=='A')
{
cout<<"请问你要毒谁???"<<endl<<"输入:";
cin>>kill2;
while(player[kill2].life!=1)
{
cout<<"输入错误,请重新输入:"<<endl;
cin>>kill2;
}
duyao=0;
}
}
}
else
{
bool b=0;
cout<<"请问你是否要用解药???"<<endl;
int FFF=0,kkkk;
for(int i=1;i<=n;i++)
{
if(player[i].life==1&&player[i].name=="村民 ")
FFF++;
if(player[i].name=="女巫 ")
kkkk=i;
}
if(jieyao==1&&player[kkkk].life==1)
{
if(FFF==1)
{
if(shou==kill1)
jieyao=1;
else
jieyao=0;
kill1=0;
b=1;
}
else
for(int i=1;i<=n;i++)
{
if(player[i].name=="女巫 "&&kill1==i)
{
kill1=0;
if(shou==kill1)
jieyao=1;
else
jieyao=0;
b=1;
break;
}
else if(player[i].name=="预言家 "&&kill1==i)
{
kill1=0;
if(shou==kill1)
jieyao=1;
else
jieyao=0;
b=1;
break;
}
}
}
Sleep(3000);
if(b==0&&duyao==1&&player[kkkk].life==1)
{
system("cls");
print(1,1);
cout<<"请问你是否要用毒药???"<<endl;
srand(time(0));
int x=rand()%2;
Sleep(1500);
cout<<"请问你要毒谁???"<<endl;
if(x==1)
{
duyao=0;
int y=rand()%n+1;
while((player[y].name=="女巫 "||player[y].name=="预言家 "||y==kill1)||player[y].life==0)
y=rand()%n+1;
kill2=y;
}
}
else
{
Sleep(3000);
system("cls");
print(1,1);
cout<<"请问你是否要用毒药???"<<endl;
Sleep(3000);
cout<<"请问你要毒谁???"<<endl;
Sleep(3000);
}
}
Sleep(3000);
system("cls");
print(1,1);
cout<<"女~巫~请~闭~眼~~~"<<endl;
if(n>6)
{
Sleep(3000);
system("cls");
print(1,1);
cout<<"预~言~家~请~睁~眼~~~"<<endl;
if(player[MY].name=="预言家 ")
{
Sleep(3000);
cout<<"请问你想查验谁???"<<endl<<"输入:";
int x;
cin>>x;
player[x].know=1;
Sleep(2000);
system("cls");
print(1,1);
cout<<"他的身份是:";
if(player[x].name=="狼人 ")
cout<<"狼人"<<endl;
else
cout<<"好人"<<endl;
Sleep(3000);
}
else
{
Sleep(3000);
cout<<"请问你想查验谁???"<<endl;
Sleep(3000);
system("cls");
print(1,1);
cout<<"他的身份是:......";
Sleep(3000);
}
Sleep(3000);
system("cls");
print(1,1);
cout<<"预~言~家~请~闭~眼~~~"<<endl;
}
Sleep(3000);
if(kill1!=0)
player[kill1].life=0;
if(kill2!=0)
player[kill2].life=0;
player[kill1].how=1;
player[kill2].how=3;
system("cls");
system("color F0");
print(2,0);
}
void night2(int hhh,int hhhh)
{
system("cls");
system("color 0f");
print(hhh,hhhh);
cout<<"天~黑~请~闭~眼~~~"<<endl;
if(n>=12)
shoushui(hhh,hhhh);
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"狼~人~请~睁~眼~~~"<<endl;
if(player[MY].name=="狼人 "&&player[MY].life==1)
{
Sleep(3000);
cout<<endl<<"请问你们要杀谁:"<<endl<<"输入:";
cin>>kill1;
Sleep(1500);
system("cls");
print(hhh,hhhh);
cout<<"今晚你们要杀的是"<<kill1<<"号玩家"<<endl;
}
else
{
Sleep(4000);
system("cls");
print(hhh,hhhh);
cout<<"请问你们要杀谁?"<<endl;
do
{
srand(time(0));
int x=rand()%n+1;
if(player[x].name!="狼人 "&&player[x].life==1)
{
kill1=x;
break;
}
}
while(1);
Sleep(5000);
}
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"狼~人~请~闭~眼~~~"<<endl;
Sleep(2000);
system("cls");
print(hhh,hhhh);
cout<<"女~巫~请~睁~眼~~~"<<endl;
Sleep(2000);
system("cls");
print(hhh,hhhh);
if(player[MY].name=="女巫 "&&player[MY].life==1)
{
Sleep(1000);
if(jieyao==1)
{
cout<<"今晚"<<kill1<<"号玩家被杀"<<endl;
Sleep(500);
cout<<"请问你要救吗???"<<endl<<"A. 救 B.不救"<<endl<<"输入:";
cin>>a;
if(a=='A')
{
system("cls");
print(hhh,hhhh);
cout<<"请问你要毒吗???"<<endl;
Sleep(2000);
system("cls");
print(hhh,hhhh);
cout<<"今晚"<<kill1<<"号玩家被你解救"<<endl;
jieyao=0;
if(shou!=kill1)
kill1=0;
}
else
{
if(shou==kill1)
kill1=0;
Sleep(2000);
system("cls");
print(hhh,hhhh);
cout<<"请问你要毒吗???"<<endl<<"A. 毒 B.不毒"<<endl<<"输入:";
cin>>a;
if(a=='A')
{
cout<<"请问你要毒谁???"<<endl<<"输入:";
cin>>kill2;
while(player[kill2].life!=1)
{
cout<<"输入错误,请重新输入:"<<endl;
cin>>kill2;
}
duyao=0;
}
}
}
else if(duyao==1)
{
if(shou==kill1)
kill1=0;
Sleep(2000);
system("cls");
print(hhh,hhhh);
cout<<"请问你要毒吗???"<<endl<<"A. 毒 B.不毒"<<endl<<"输入:";
cin>>a;
if(a=='A')
{
cout<<"请问你要毒谁???"<<endl<<"输入:";
cin>>kill2;
while(player[kill2].life!=1)
{
cout<<"输入错误,请重新输入:"<<endl;
cin>>kill2;
}
duyao=0;
}
}
else
{
Sleep(2000);
system("cls");
print(hhh,hhhh);
cout<<"请问你要毒吗???"<<endl;
}
}
else
{
bool b=0;
cout<<"请问你是否要用解药???"<<endl;
int FFF=0,kkkk;
for(int i=1;i<=n;i++)
{
if(player[i].life==1&&player[i].name=="村民 ")
FFF++;
if(player[i].name=="女巫 ")
kkkk=i;
}
if(jieyao==1&&player[kkkk].life==1)
{
if(FFF==1)
{
if(shou==kill1)
jieyao=1;
else
jieyao=0;
kill1=0;
b=1;
}
else
for(int i=1;i<=n;i++)
{
if(player[i].name=="女巫 "&&kill1==i)
{
kill1=0;
if(shou==kill1)
jieyao=1;
else
jieyao=0;
b=1;
break;
}
else if(player[i].name=="预言家 "&&kill1==i)
{
kill1=0;
if(shou==kill1)
jieyao=1;
else
jieyao=0;
b=1;
break;
}
}
}
Sleep(3000);
if(b==0&&duyao==1&&player[kkkk].life==1)
{
system("cls");
print(hhh,hhhh);
cout<<"请问你是否要用毒药???"<<endl;
srand(time(0));
int x=rand()%2;
Sleep(1500);
cout<<"请问你要毒谁???"<<endl;
if(x==1)
{
duyao=0;
int y=rand()%n+1;
while((player[y].name=="女巫 "||player[y].name=="预言家 "||y==kill1)||player[y].life==0)
y=rand()%n+1;
kill2=y;
}
}
else
{
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"请问你是否要用毒药???"<<endl;
Sleep(3000);
cout<<"请问你要毒谁???"<<endl;
Sleep(3000);
}
}
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"女~巫~请~闭~眼~~~"<<endl;
if(n>6)
{
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"预~言~家~请~睁~眼~~~"<<endl;
if(player[MY].name=="预言家 "&&player[MY].life==1)
{
Sleep(3000);
cout<<"请问你想查验谁???"<<endl<<"输入:";
int x;
cin>>x;
player[x].know=1;
Sleep(2000);
system("cls");
print(hhh,hhhh);
cout<<"他的身份是:";
if(player[x].name=="狼人 ")
cout<<"狼人"<<endl;
else
cout<<"好人"<<endl;
Sleep(3000);
}
else
{
Sleep(3000);
cout<<"请问你想查验谁???"<<endl;
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"他的身份是:......";
Sleep(3000);
}
Sleep(3000);
system("cls");
print(hhh,hhhh);
cout<<"预~言~家~请~闭~眼~~~"<<endl;
}
Sleep(3000);
if(kill1!=0)
player[kill1].life=0;
if(kill2!=0)
player[kill2].life=0;
player[kill1].how=1;
player[kill2].how=3;
system("cls");
system("color F0");
print(hhh+1,0);
}
bool lr=0;
void panduanlieren()
{
if(lr==1)
return;
if(MY==lieren)
{
cout<<"请射杀一名玩家"<<endl;
int x;
cin>>x;
while(player[x].life!=1)
{
cout<<"输入错误,请重新输入"<<endl;
cin>>x;
}
Sleep(1000);
cout<<lieren<<"号猎人发动技能,开枪带走了"<<x<<"号"<<endl;
player[x].life=0;
player[x].how=4;
}
else if(n>=9)
{
srand(time(0));
int x=rand()%n+1;
while(player[x].life!=1)
{
x=rand()%n+1;
}
Sleep(1000);
cout<<lieren<<"号猎人发动技能,开枪带走了"<<x<<"号"<<endl;
player[x].life=0;
player[x].how=4;
}
lr=1;
}
void print1()
{
cout<<"天亮了,昨晚";
if(kill1!=0||kill2!=0)
{
cout<<kill1<<"号";
if(kill2!=0)
{
cout<<","<<kill2<<"号";
kill2=0;
}
cout<<"被杀"<<endl;
}
else
cout<<"是平安夜"<<endl;
}
int main()
{
system("cls");
cout<<" "<<"狼人杀online"<<endl;
cout<<"请输入人数个数:"<<endl;
scanf("%d",&n);
cout<<"加载时间长,请耐心等待";
init1();
init2(n);
int k=1;
do
{
srand(time(0));
init3(k);
cout<<".";
Sleep(17);
k++;
}
while(k<=n);
system("cls");
system("color F0");
cout<<"游戏即将开始";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
Sleep(1500);
cout<<endl<<endl<<"请大家查看身份牌......"<<endl;
Sleep(45);
srand(time(0));
MY=rand()%n+1;
cout<<"您的身份是:"<<player[MY].name<<endl;
Sleep(500);
cout<<"在"<<player[MY].num<<"号位上"<<endl;
system("pause");
system("cls");
player[MY].know=2;
print(1,0);
cout<<"即将进入夜晚";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
night();
print1();
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
toupiao(2,0);
system("cls");
print(2,0);
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
else if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
cout<<"即将进入夜晚";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
night2(2,1);
print1();
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
toupiao(3,0);
system("cls");
print(3,0);
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
else if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
cout<<"即将进入夜晚";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
night2(3,1);
print1();
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
if(player[lieren].life==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
toupiao(4,0);
system("cls");
print(4,0);
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
else if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
cout<<"即将进入夜晚";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
night2(4,1);
print1();
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
if(player[lieren].life==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
toupiao(5,0);
system("cls");
print(5,0);
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
else if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
cout<<"即将进入夜晚";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
night2(5,1);
print1();
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
if(player[lieren].life==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
toupiao(6,0);
system("cls");
print(6,0);
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
else if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
cout<<"即将进入夜晚";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(500);
}
night2(6,1);
print1();
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
if(player[lieren].life==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
toupiao(7,0);
system("cls");
print(7,0);
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
else if(player[lieren].life==0&&lr==0)
{
panduanlieren();
}
if(game_over())
{
Sleep(1000);
system("cls");
cout<<"游戏结束"<<endl;printhhh();
return 0;
}
while(1)
system("pause");
return 0;
}