高级启示者
声明:人机是可以过去的,我试了30多次,终于通过了
改进:双人模式容易被发现出的是什么的问题,做了评价
#include<bits/stdc++.h>
#include<windows.h>
#include<cstdlib>
#include<time.h>
using namespace std;
int main(){
srand((unsigned) time(NULL));
long long a;
MessageBox(NULL,"鑫汇工作室出品(李宜和)","鑫汇工作室",MB_OK);
cout<<endl;
cout<<"\t\t\t\t鑫汇";
Sleep(3000);
system("cls");
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"\t\t\t\t加载中";
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
system("cls");
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
cout<<".";
Sleep(300);
system("cls");
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"\t\t\t\t完成!";
system("cls");
MessageBox(NULL,"1=石头,2=剪刀,3=布","规则",MB_OK);
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 1.游戏(人机) 2.(手动) |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
int z;
cin>>z;
if(z==1){
system("cls");
long long re=0;
while(1){
long long n,m=0,o,h=0;
o=rand()%3+1;
cin>>n;
if(n>3||n<1){
cout<<"只可输入1,2,3"<<endl;
system("cls");
}else if(n==1||n==2||n==3){
m+=1;
cout<<"您现在的得分是"<<re ;
Sleep(2000);
system("cls");
if(m==1){
cout<<"你出的是";
if(n==1){
cout<<"石头\t\t\t";
}else if(n==2){
cout<<"剪刀\t\t\t";
}else if(n==3){
cout<<"布\t\t\t";
}
cout<<"人机出的是";
if(o==1){
cout<<"石头\t\t\t";
}else if(o==2){
cout<<"剪刀\t\t\t";
}else if(o==3){
cout<<"布\t\t\t";
}
Sleep(2000);
}
//____________________________________________
if(o==n){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 平局 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"不加分。"<<endl;
cout<<"您现在的得分是"<<re<<endl;
}
//______________________________________________
if(o==2&&n==3){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你输了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"你输了哦!"<<endl;
if(re!=0){
re--;
}else if(re==0){
re++;
re--;
}
cout<<"您现在的得分是"<<re<<endl;
}
if(o==3&&n==1){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你输了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"你输了哦!"<<endl;
if(re!=0){
re--;
}else if(re==0){
re++;
re--;
}
cout<<"您现在的得分是"<<re<<endl;
}
if(o==1&&n==2){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你输了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"你输了哦!"<<endl;
if(re!=0){
re--;
}else if(re==0){
re++;
re--;
}
cout<<"您现在的得分是"<<re<<endl;
}
//_________________________________________________
if(o==1&&n==3){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你赢了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"你赢了哦!"<<endl;
re+=1;
cout<<"您现在的得分是"<<re<<endl;
}
if(o==2&&n==1){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你赢了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"你赢了哦!"<<endl;
re+=1;
cout<<"您现在的得分是"<<re<<endl;
}
if(o==3&&n==2){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你赢了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
cout<<"你赢了哦!"<<endl;
re+=1;
cout<<"您现在的得分是"<<re<<endl;
}
if(re==5){
system("cls");
cout<<"恭喜闯关成功 ";
Sleep(2000);
break;
}
//_________________________________________________
}
}
}
if(z==2){
system("cls");
cout<<"输入一两数,按Enter,让另外一个人输入两个数,按Enter。"<<endl;
cout<<"左边是先输入的,右边是后输入的";
Sleep(2000);
system("cls");
while(1){
long long n,m=0,o,f,g,cv,vb;
cin>>n>>cv;
system("cls");
cin>>o>>vb;
system("cls");
//____________________________________________
if((n*cv)%3==(o*vb)%3){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 平局 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
//______________________________________________
if((o*vb)%3==2&&(n*cv)%3==3){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你输了 你赢了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
if((o*vb)%3==3&&(n*cv)%3==1){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你输了 你赢了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
if((o*vb)%3==1&&(n*cv)%3==2){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你输了 你赢了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
//_________________________________________________
if((o*vb)%3==1&&(n*cv)%3==3){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你赢了 你输了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
if((o*vb)%3==2&&(n*cv)%3==1){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你赢了 你输了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
if((o*vb)%3==3&&(n*cv)%3==2){
system("cls");
cout<<"——————————————————————————————"<<endl;
cout<<"| |"<<endl;
cout<<"| 你赢了 你输了 |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"——————————————————————————————"<<endl;
}
//_________________________________________________
}
}
system("cls");
cout<<"你对此游戏的评价:1.1星,2.2星,3.3星,4.4星,5.5星"<<endl;
int qw;
while(1){
cin>>qw;
system("cls");
if(qw>5||qw<=0){
cout<<"输入失败";
Sleep(1000);
system("cls");
}else{
cout<<"谢谢你的评价";
Sleep(1000);
break;
}
}
system("cls");
cout<<"如果您能发现bug/问题,请发在贴上,重要的给10~50豆";
Sleep(3000);
return 0;
}
李宜和在2021-06-26 13:27:26追加了内容
由于复制问题,方框可能不对齐,请见谅
李宜和在2021-06-26 13:35:18追加了内容
ding
李宜和在2021-06-26 22:07:32追加了内容
ding