void greet()
{
cout<<"Welcome to cletus's Bad slots"<<endl<<endl;
return;
}
int menu()
{
int choice;
cout<<"\t\tWelcome to Cletus's Horrible Slots"<<endl<<endl;
cout<<"\t\t\t1. Check Bank Balance"<<endl;
cout<<"\t\t\t2. Transfer Money"<<endl;
cout<<"\t\t\t3. Play the game"<<endl;
cout<<"\t\t\t4. Leave"<<endl;
cout<<"\t\t\tChoose one of the follow"<<endl;
cin>> choice; //User choice
return choice;
}
void bank_funds(int & bank_bal, int & game_bal)
{
srand(5);
bank_bal = 100 * ( rand() % 8 + 2);
cout<<"\t\t\tYour bank balance"<<bank_bal<<endl;
cout<<"\t\t\tYour game balance"<<game_bal<<endl<<endl;
return;
}
void transfers(int & game_bal, int & bank_bal)
{
int transfer;
do
{
cout<<"\t\t\tHow much would you like to transfer."
<<"Only in multiples of 100"<<endl;
cin>>transfer;
transfer *= 100;
if(bank_bal > transfer && transfer > 0)
{
if( bank_bal >= NO_MATCH)
cout<<"\t\t\tACCEPTED"<<endl<<endl;
else
cout<<"\t\t\tYOU LOSE"<<endl<<endl;
}
else if (transfer < 0)
{
cout<<"\t\t\tYou can not return back to the bank"<<endl;
}
else
cout<<"\t\t\tYou don't have enought money"<<endl;
}while (transfer < 0 || transfer > bank_bal);
bank_bal= bank_bal - transfer;
game_bal = game_bal + transfer;
cout<<"Bank Balance: "<<bank_bal<<endl;
cout<<"Game Balance: "<<bank_bal<<endl;
return;
}
void spin(int & game_bal, int & bank_bal, int & wins, int & triples, int & doub
{
int spins = 0;
char letter_1 = 'a';
char letter_2 = 'b';
char letter_3 = 'c';
char letter_4 = 'd';
int symbol1_count, symbol2_count, symbol3_count, symbol4_count;
int spin_count = 0; //Spins counted
int rand_letter; //Random Letter
int rand_letr_count; //Number of random letters
static int jackpot_count = 0; //Number of jackpots
do
{
cout<<"\t\t\tHow many spins would you like?"<<endl;
//Number of spins the user wants
cin>> spins;
if (game_bal <( NO_MATCH * spins))
{
cout<<"\t\t\tYou are going to overdrawn your account."
<<"Pick a smaller amount of spins"<<endl; //Error message
}
else if (spins < 0)
cout << "\t\t\tyou can't spin negative times"<<endl;
else if(symbol1_count == 2 || symbol2_count == 2 || symbol3_count == 2 ||
symbol4_count == 2)
{
jackpot_count++;
wins++;
doubles++;
if(jackpot_count % LUCKY_NUMB == 0)
{
cout<<"\t\t\tWOW! YOU HAVE WON THE JACKPOT. WON $"<<JACKPOT<<" "
<<endl<<endl;
game_bal += JACKPOT;
}
else
{
cout<<"\t\t\tYou won the Double Pay"<<DOUBLE_PAY<<" "
<<endl<<endl;
game_bal += DOUBLE_PAY;
}
cout<<"\t\t\tBank Balance: "<<bank_bal<<endl;
cout<<"\t\t\tGame Balance: "<<game_bal<<endl;
}
else
{
cout<<"\t\t\tSorry you lost $"<<NO_MATCH<<" "<<endl<<endl;
game_bal -= NO_MATCH;
cout<<"\t\t\tBank Balance: "<<bank_bal<<endl;
cout<<"\t\t\tGame Balance: "<<game_bal<<endl;
}
}
return;
}
void SignOff(bool & loop, int & bank_bal, int & game_bal, int & wins, int & dou
{
cout<<"\t\t\tYour bank balance: "<<bank_bal<<endl;
cout<<"\t\t\tYour game balacne: "<<game_bal<<endl;
bank_bal =+ game_bal;
cout<<"\t\t\tYour ending bank balance: "<<bank_bal<<endl;
cout<<"\t\t\tYour ending game balance: "<<game_bal<<endl;
bank_bal =+ game_bal;
cout<<"\t\t\tYour ending bank balance: "<<bank_bal<<endl;
cout<<"\t\t\tYour ending game balance: "<<game_bal<<endl;
cout<<"\t\t\tWins"<<wins<<"Triples"<<triples<<"Doubles"<<doubles<<endl;
cout<<"\t\t\tThank you for playing"<<endl;