hello大家好,我是阳了个阳C++,最近某游戏的恶魔轮盘赌非常出名,所以我也用C++复刻了一个。话不多说,请看代码:
这一版是无道具版(因为道具太难写了……)
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string name;
int t,f,life,th;
bool check[21];
void cls(){
system("cls");
}
void startgame(){
system("color 4");
cout<<"欢迎来到恶魔轮盘赌\n\n";
Sleep(2000);
cout<<"我是你的对手,StarSword\n\n";
Sleep(2000);
cout<<"请输入你的名字\n";
cin>>name;
cls();
}
void choose(){
cout<<name<<",请选择每轮真弹数量,假弹数量,以及电量格数\n";
Sleep(2000);
cin>>t>>f>>life;
cls();
}
void reload(){
int T=t,F=f;
for(int i=1;i<=t+f;i++){
int tmp=rand()%2;
if(tmp==1){
if(T){
T--;
check[i]=1;
continue;
}
}
F--;
check[i]=0;
}
}
int main(){
srand(time(NUL