#include<iostream>
#include<string>
#include<stdlib.h>
using namespace std;
//Function List
void fplayername();
void fgrid();
void fcode();
void fterminate();
void fcheck();
void fend();
//Global Variables
char name[20];
int code;
int main()
{
cout<<"Welcome to Bingo Bonanza"<<endl;
fplayername();
fgrid();
fterminate();
return 0;
}
void fplayername()//Gives Playername
{
cout<<"Enter Player Name: ";
cin>>name;
cout<<"(Player: "<<name<<")"<<endl;
}
void fgrid()//The Grid
{
int i, j=1, k=5;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
for(i=1; i<=2; i++)
{
while(j<=k)
{
cout<<"\t<"<<j<<">";
j++;
}
cout<<"\n";
cout<<"\n";
k=k+5;
}
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
fcode();
}
void fcode()//Choosing a code from the grid
{
cout<<"Choose a cell code from above:";
cin>>code;
fcheck();
}
void fcheck()//Looks for the question
{
switch(code)
{
case 1: cout<<"Moving to the question..."<<endl; break;
case 2: cout<<"Moving to the question..."<<endl; break;
case 3: cout<<"Moving to the question..."<<endl; break;
case 4: cout<<"Moving to the question..."<<endl; break;
case 5: cout<<"Moving to the question..."<<endl; break;
case 6: cout<<"Moving to the question..."<<endl; break;
case 7: cout<<"Moving to the question..."<<endl; break;
case 8: cout<<"Moving to the question..."<<endl; break;
case 9: cout<<"Moving to the question..."<<endl; break;
case 10: cout<<"Moving to the question..."<<endl; break;
default: fcode();
}
}
void fterminate()//Ends Program
{
char askterminate;
cout<<"Do you want to end the program?<y/n>:";
cin>>askterminate;
if(askterminate=='y'||askterminate=='Y')
{
cout<<"Thank You for Playing Bingo Bonanza!!"<<endl;
}
else if(askterminate=='n'||askterminate=='N')
{
cout<<"Restarting Game"<<endl;
system("cls");
main();
}
else
fterminate();
}
#include<string>
#include<stdlib.h>
using namespace std;
//Function List
void fplayername();
void fgrid();
void fcode();
void fterminate();
void fcheck();
void fend();
//Global Variables
char name[20];
int code;
int main()
{
cout<<"Welcome to Bingo Bonanza"<<endl;
fplayername();
fgrid();
fterminate();
return 0;
}
void fplayername()//Gives Playername
{
cout<<"Enter Player Name: ";
cin>>name;
cout<<"(Player: "<<name<<")"<<endl;
}
void fgrid()//The Grid
{
int i, j=1, k=5;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
for(i=1; i<=2; i++)
{
while(j<=k)
{
cout<<"\t<"<<j<<">";
j++;
}
cout<<"\n";
cout<<"\n";
k=k+5;
}
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
fcode();
}
void fcode()//Choosing a code from the grid
{
cout<<"Choose a cell code from above:";
cin>>code;
fcheck();
}
void fcheck()//Looks for the question
{
switch(code)
{
case 1: cout<<"Moving to the question..."<<endl; break;
case 2: cout<<"Moving to the question..."<<endl; break;
case 3: cout<<"Moving to the question..."<<endl; break;
case 4: cout<<"Moving to the question..."<<endl; break;
case 5: cout<<"Moving to the question..."<<endl; break;
case 6: cout<<"Moving to the question..."<<endl; break;
case 7: cout<<"Moving to the question..."<<endl; break;
case 8: cout<<"Moving to the question..."<<endl; break;
case 9: cout<<"Moving to the question..."<<endl; break;
case 10: cout<<"Moving to the question..."<<endl; break;
default: fcode();
}
}
void fterminate()//Ends Program
{
char askterminate;
cout<<"Do you want to end the program?<y/n>:";
cin>>askterminate;
if(askterminate=='y'||askterminate=='Y')
{
cout<<"Thank You for Playing Bingo Bonanza!!"<<endl;
}
else if(askterminate=='n'||askterminate=='N')
{
cout<<"Restarting Game"<<endl;
system("cls");
main();
}
else
fterminate();
}