Brongaa

Followers of Brongaa Unite

Please Read:
Do you want to join Bronquians? Then Register with your name inside the game of GCPH and we will accept you.
Interested on becoming a moderator? Join now and post in the Brongaa's Proclamation Board for your application.

You are not connected. Please login or register

Bingo Bonanza Source Code

Go down  Message [Page 1 of 1]

1 Bingo Bonanza Source Code on Wed Feb 23, 2011 8:55 pm

Flayvor

avatar
Bronquian Citizen
Bronquian Citizen
#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();
}

View user profile

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum