My first game based on my fav game

#include

#include

using namespace std;

int r=3,x=0,l=1,pay;

void redemption()

{

int b1,b2,b3;

char y[100]="try";

const int a1=rand()%r+r;

const int a2=rand()%r+r;

const int a3=rand()%r+r;

const int sum= a1+a2+a3;

const int product=a1a2a3;

cout<<“The sum of the keys for safe-”<<l<<" should be “<<sum<<” and the product should be "<<product;

cout<<"\n I guessed the 3 keys to be \n";

cin>>b1>>b2>>b3;

int s=b1+b2+b3;

int p=b1b2b3;

if(s==sum && p==product)

{

 pay=rand()%4+1;

 cout<<"\n We got the safe-"<<l<<" unlocked and got "<<pay<<"k dollas \n";

 x=x+pay;

}

else

{

 cout<<"\n Wrong key.The safe's broke try another yells John\n";

}

l++;

}

int main()

{

srand(time(NULL));

cout<<“We followed Hosea’s distraction and barged into the bank.”;

cout<<“Dutch forced the manager to give up the safe key combinations but he gave us them riddles.Micah tried to kill him but Dutch said the gunshot draw unwanted attention.So I tried my best to solve the riddles\n”;

while (r<7)

{

redemption();

r++;

}

cout<<“By the end we got a payload of $”<<x<<“k”;

if(x<3)

 cout<<"\nWasn't worth the lifes of Hosea and Lenny says Dutch";

else

 cout<<"\nHope its worth the lifes of Hosea and young Lenny";

}

1 Like

I’m so happy for you! You made a game based on your fav game! That’s so cool!

Privacy & Terms