Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Continuing with Bingo Now that we have our Bingo Cards we should play Bingo!!! C

ID: 3600012 • Letter: C

Question

Continuing with Bingo

Now that we have our Bingo Cards we should play Bingo!!!

Create a program that will:

do everything from program 2 (create bingo cards), if you didn't get this working just right go see TAs/professor As Soon As Possible

Add an option 4 to your menu for Play Bingo

read in a bingo call (e,g, B6, I17, G57, G65)

checks to see if the bingo call read in is valid (i.e., G65 is not valid)

marks all the boards that have the bingo call

checks to see if there is a winner, for our purposes winning means

5 tokens in a row or column

5 tokens in a diagonal

1 token in each of the 4 corners of the game board

Loop accepting bingo calls until there is a winner, and display an appropriate message specifying which user won, print their bingo card, and how they won (5 in a row with calls B6, I20, ...; 5 in a column with calls ...; 5 on a diagonal with calls ... ; 4 corners with calls ...)

Explanation / Answer

hello I have this code for generating cards in a bingo game. It has a range, e.g. (B=1-15, I=16=30....

BINGO.cpp : main file.

#include<iostream>

#include<ctime>

#include <windows.h>

using namespace std;

void ClearScreen();

int main()

{

int num[5][5],number,row,col;

int ask;

bool ok = true;

srand((unsigned) time(0));

do{

ClearScreen();

cout<<" BINGO GAME"<<endl;

for(row=0;row<5;row++)

for(col=0;col<5;col++)

num[row][col]=0; // Zeroes out all the rows & columns

cout<<" B I N G O"<<endl;

cout<<" ";

for(col = 0;col < 5; col++)

{

for (row=0;row < 5; row++)

{

do

{

ok = true;

number = 1+(col*15) + rand()%15;

for (int ck=0;ck<5;ck++)

{

if (number == num[ck][col])

ok = false; // Same number , so create a new number

}

}while (!ok);

num[row][col] = number;

}

}

for(row = 0;row < 5; row++)

{

for (col=0;col < 5; col++)

{

if((row==2)&&(col==2))

cout<<" FREE ";

else

cout << " " << num[row][col] << " ";

}

cout << endl;

}

{

cout<<" Is this the card you want to use? [0 for no only.] : ";

cin>>ask;

}

} while(ask==0);

return 0;

}

void ClearScreen()

{

DWORD n;

DWORD size;

COORD coord = {0};

CONSOLE_SCREEN_BUFFER_INFO csbi;

HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );

GetConsoleScreenBufferInfo ( h, &csbi );

size = csbi.dwSize.X * csbi.dwSize.Y;

FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &n );

GetConsoleScreenBufferInfo ( h, &csbi );

FillConsoleOutputAttribute ( h, csbi.wAttributes, size, coord, &n );

SetConsoleCursorPosition ( h, coord );

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote