Professional Documents
Culture Documents
Pacanea C++
Pacanea C++
#include <time.h>
#include <ctype.h>
using namespace std;
while(credit!=0){
cout<<"Credit: "<<credit<<endl;
cout<<"Enter gambilng money(NUMBER ONLY): ";
cin>>gamb;
if(gamb<=0){
cout<<endl;
cout<<"Gamble money must be higher than 0!";
cout<<endl;
cout<<"Enter gambilng money: ";
cin>>gamb;
}
if(gamb<=credit){
credit=credit-gamb;
}
else while(gamb>credit){
cout<<endl;
cout<<"Gamble money must be lower than your credit!";
cout<<endl;
cout<<"Enter gambilng money: ";
cin>>gamb;
}
cout << "Cash out? Press:y" << endl;
while (gamb != 0 && gamb <= 1000000)
{
val = rand () % 2;
cout << "Gambled money: " << gamb << endl;
cout << "r/n or cash out?";
cout << endl;
cin >> rn;
ver = *colour[val];
if (rn == ver && rn != *colour[2])
{
gamb = gamb * 2;
}
else if(rn != ver){
gamb=0;
}