SlideShare a Scribd company logo
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void FillBingoCard(int bingocard[5][5]);
void PrintCard(int bingocard[5][5], int called[3], char yn[1]);
int PickNumber(int called[3], int callednumber[75], int counter);
int drawnnumber(int bingocard[5][5], int called[3]);
void completedrowcolumn(int bingocard[5][5], int win);
int main(void)
{
//array of bingo numbers
int row = 5;
int col = 5;
int bingocard[row][col];
int called[3];
int counter = 0;
int callednumber[75];
char yn[1];
int win = 0;
//fill bingocard
void FillBingoCard(int bingocard[5][5])
{
int i, j, k;
int temp;
srand(time(NULL));
for (i = 0; i < 5; i++)
{
for (j = 0; j < 5; j++)
{
temp = rand() % 15 + 1 + j * 15;
for (k = 0; k < j; k++)
{
if (temp == bingocard[i][k])
{
j--;
break;
}
}
bingocard[i][j] = temp;
}
}
bingocard[2][2] = -1;
}
void PrintCard(int bingocard[5][5], int called[3], char yn[1])
{
int i, j;
printf(" B I N G On");
for (i = 0; i < 5; i++)
{
printf("----------------------n");
for (j = 0; j < 5; j++)
{
if (bingocard[i][j] == -1)
{
printf("| X ");
}
else if (called[0] == 'B' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'I' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'N' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'G' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'O' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else
{
printf("| %2d", bingocard[i][j]);
}
}
printf("|n");
}
printf("----------------------n");
printf("Have you got number %c%d? (Y/N) ", called[0], called[1]);
scanf(" %c", yn);
}
int PickNumber(int called[3], int callednumber[75], int counter)
{
int temp;
srand(time(NULL));
do
{
temp = rand() % 75 + 1;
} while (callednumber[temp - 1] != 0);
callednumber[temp - 1] = 1;
called[1] = temp;
if (temp <= 15)
{
called[0] = 'B';
}
else if (temp <= 30)
{
called[0] = 'I';
}
else if (temp <= 45)
{
called[0] = 'N';
}
else if (temp <= 60)
{
called[0] = 'G';
}
else
{
called[0] = 'O';
}
return *called;
}
int drawnnumber(int bingocard[5][5], int called[3])
{
int row, col;
int found = 0;
for (row = 0; row < 5; row++)
{
for (col = 0; col < 5; col++)
{
if (bingocard[row][col] == called[1])
{
bingocard[row][col] = -1;
found = 1;
}
}
}
if (found == 1)
{
return 1;
}
else
{
return 0;
}
}
{
int row, col;
// check for completed rows
for (row = 0; row < 5; row++)
{
int count = 0;
for (col = 0; col < 5; col++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed row %d.", row + 1);
win = 1;
}
}
// check for completed columns
for (col = 0; col < 5; col++)
{
int count = 0;
for (row = 0; row < 5; row++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed column %d.", col + 1);
win = 1;
}
}
}
void completedrowcolumn(int bingocard[5][5], int win)
{
int row, col, diag, count;
// check for completed rows
for (row = 0; row < 5; row++)
{
count = 0;
for (col = 0; col < 5; col++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed row %d.", row + 1);
win = 1;
}
}
// check for completed columns
for (col = 0; col < 5; col++)
{
count = 0;
for (row = 0; row < 5; row++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed column %d.", col + 1);
win = 1;
}
}
// check for completed diagonal lines
count = 0;
for (diag = 0; diag < 5; diag++)
{
if (bingocard[diag][diag] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed the diagonal line from top left to bottom right.");
win = 1;
}
count = 0;
for (diag = 0; diag < 5; diag++)
{
if (bingocard[diag][4 - diag] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed the diagonal line from top right to bottom left.");
win = 1;
}
if (win == 1)
{
printf("nCongratulations! You won!");
}
}
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void FillBingoCard(int bingocard[5][5]);
void PrintCard(int bingocard[5][5], int called[3], char yn[1]);
int PickNumber(int called[3], int callednumber[75], int counter);
int drawnnumber(int bingocard[5][5], int called[3]);
void completedrowcolumn(int bingocard[5][5], int win);
int main(void)
{
//array of bingo numbers
int row = 5;
int col = 5;
int bingocard[row][col];
int called[3];
int counter = 0;
int callednumber[75];
char yn[1];
int win = 0;
//fill bingocard
void FillBingoCard(int bingocard[5][5])
{
int i, j, k;
int temp;
srand(time(NULL));
for (i = 0; i < 5; i++)
{
for (j = 0; j < 5; j++)
{
temp = rand() % 15 + 1 + j * 15;
for (k = 0; k < j; k++)
{
if (temp == bingocard[i][k])
{
j--;
break;
}
}
bingocard[i][j] = temp;
}
}
bingocard[2][2] = -1;
}
void PrintCard(int bingocard[5][5], int called[3], char yn[1])
{
int i, j;
printf(" B I N G On");
for (i = 0; i < 5; i++)
{
printf("----------------------n");
for (j = 0; j < 5; j++)
{
if (bingocard[i][j] == -1)
{
printf("| X ");
}
else if (called[0] == 'B' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'I' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'N' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'G' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else if (called[0] == 'O' && called[1] == bingocard[i][j])
{
printf("| %2d", bingocard[i][j]);
}
else
{
printf("| %2d", bingocard[i][j]);
}
}
printf("|n");
}
printf("----------------------n");
printf("Have you got number %c%d? (Y/N) ", called[0], called[1]);
scanf(" %c", yn);
}
int PickNumber(int called[3], int callednumber[75], int counter)
{
int temp;
srand(time(NULL));
do
{
temp = rand() % 75 + 1;
} while (callednumber[temp - 1] != 0);
callednumber[temp - 1] = 1;
called[1] = temp;
if (temp <= 15)
{
called[0] = 'B';
}
else if (temp <= 30)
{
called[0] = 'I';
}
else if (temp <= 45)
{
called[0] = 'N';
}
else if (temp <= 60)
{
called[0] = 'G';
}
else
{
called[0] = 'O';
}
return *called;
}
int drawnnumber(int bingocard[5][5], int called[3])
{
int row, col;
int found = 0;
for (row = 0; row < 5; row++)
{
for (col = 0; col < 5; col++)
{
if (bingocard[row][col] == called[1])
{
bingocard[row][col] = -1;
found = 1;
}
}
}
if (found == 1)
{
return 1;
}
else
{
return 0;
}
}
{
int row, col;
// check for completed rows
for (row = 0; row < 5; row++)
{
int count = 0;
for (col = 0; col < 5; col++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed row %d.", row + 1);
win = 1;
}
}
// check for completed columns
for (col = 0; col < 5; col++)
{
int count = 0;
for (row = 0; row < 5; row++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed column %d.", col + 1);
win = 1;
}
}
}
void completedrowcolumn(int bingocard[5][5], int win)
{
int row, col, diag, count;
// check for completed rows
for (row = 0; row < 5; row++)
{
count = 0;
for (col = 0; col < 5; col++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed row %d.", row + 1);
win = 1;
}
}
// check for completed columns
for (col = 0; col < 5; col++)
{
count = 0;
for (row = 0; row < 5; row++)
{
if (bingocard[row][col] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed column %d.", col + 1);
win = 1;
}
}
// check for completed diagonal lines
count = 0;
for (diag = 0; diag < 5; diag++)
{
if (bingocard[diag][diag] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed the diagonal line from top left to bottom right.");
win = 1;
}
count = 0;
for (diag = 0; diag < 5; diag++)
{
if (bingocard[diag][4 - diag] == -1)
{
count++;
}
}
if (count == 5)
{
printf("nBINGO! You completed the diagonal line from top right to bottom left.");
win = 1;
}
if (win == 1)
{
printf("nCongratulations! You won!");
}
}
* It should also include the lines, and mark any called numbers with 'X'. If a number called isn't on
my card and I indicate 'Y' that yes, I do have it, it should print me a message saying that I cheated
and end the game. It should be in C. If you help, please send a working code so that I can check
with mine!
The next number is 065 Do you have it? (Y/N)Y That value is not on your BINGo card - are you
trying to cheat??For filling the card with unique numbers, you have to go through the BINGO card
column by column (rather than row by row which is what we normally do for 2D arrays). Since the
BINGO card has 5 columns, this would be a good place to use a for loop. Now, for each column
(inside the for loop), you need to find 5 unique values that fit within the allowed range for that
column. So, WHILE you haven't found all 5, get a random number in range, check if you have
already gotten it in that column - if you have, throw it out and get another - if you haven't, put it in
your BINGO card. So for the Oth column, your number needs to be 1-15 1st column, your number
needs to be 1630 2nd column, your number needs to be 31-45 3 rd column, your number needs to
be 46-60 4th column, your number needs to be 61-75Create a function to print the bingo card to
the screen. You must match the formatting shown in the sample output. The bingo array must be
passed to this function. Create a function to pick a number that has not already been chosen. You
will need to use a 10 array to keep track of which numbers between 1 and 75 have been used so
that you don't pick numbers that have already been called. If you randomly pick a number that was
already called, then pick another. Continue this process until you find a number that has not been
previously called. Print the number to the screen along with its corresponding letter. This function
should return that value. Do NOT create an array of 75 unique numbers - pick one number at a
time and ensure it has not already been used. Create a function to determine if a called number
exists in the player's bingo card. Pass the bingo array and the number to the function. Loop over
the array (nested for loops) and, if the number is found in the bingo array, then change the value
to 0 to "mark" it. If the number is found, then this function should return true; otherwise, return
false. PLEASE REMEMBER THAT YOU ARE NOT ALLOWED TO USE re turn TO STOP A
LOOP. Create a function to check for a completed row. A completed row is a row in the bingo
array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to
zero to indicate that the called number matches one in our bingo card). This function should check
every row in the bingo array and return whether or not it found a completed row. Create a function
to check for a completed column. A completed column is a column in the bingo array that has 0 for
every value (we "marked" our bingo numbers by changing the existing value to zero to indicate
that the called number matches one in our bingo card). This function should check every column in
the bingo array and return whether or not it found a completed column. Create a function to check
for a completed diagonal. A completed diagonal is a diagonal in the bingo array that has 0 for
every value (we "marked" our bingo numbers by changing the existing value to zero to indicate
that the called number matches one in our bingo card). This function should check both diagonals
in the bingo array and return whether or not it found a completed diagonal. Add prototypes for the
functions at the top of the program. main() Call function to fill bingo card Call function to print bingo
card to screen While the player has not won and while there are still numbers to choose from
(there are 75 total) Call a function to pick a number that has not been chosen already - this
function returns the called number. Show the player the number (including the B, I, N, G or O ) and
ask if the player has that number on their bingo card. If the player answers anything other than
something that begins with ' ', then reprint the bingo card and increment the count of numbers
drawn so far. / N NOTE : Your code must use this prompt so that your code can easily be tested %
Create a 2D array that will be your bingo card. The bingo card will ONLY be 55. Make sure your
random numbers are truly random between program runs. Use srand () only once and not in a
function or loop. Create a function to fill the bingo card with random numbers in the proper ranges.
Pass your 2D bingo array to this function to be populated. Be sure to mark the free spot. The ' B '
column contains numbers between 1 and 15 The 'I' column contains numbers between 16 and 30
not hardcode any of the numbers in The ' N ' column contains numbers between 31 and 45 your
BINGO card - every number The ' G ' column contains numbers between 46 and 60 should
random and in the correct range. The ' O column contains numbers between 61 and 75 Just a
reminder - BINGO numbers MUST be unique. You cannot have the same number in multiple cells
of your BINGO card. The rules of BINGO state that every number is unique. Obtaining random
numbers using rand () does NOT guarantee that each number is unique - YOU must check that
each number is unique. If a number has already been used, then get another number. Use the
formula we went over in class to obtain numbers in a range do not hardcode every range.Create a
function to print the bingo card to the screen. You must match the formatting shown in the sample
output. The bingo array must be passed to this function. Create a function to pick a number that
has not already been chosen. You will need to use a 10 array to keep track of which numbers
between 1 and 75 have been used so that you don't pick numbers that have already been called.
If you randomly pick a number that was already called, then pick another. Continue this process
until you find a number that has not been previously called. Print the number to the screen along
with its corresponding letter. This function should return that value. Do NOT create an array of 75
unique numbers - pick one number at a time and ensure it has not already been used. Create a
function to determine if a called number exists in the player's bingo card. Pass the bingo array and
the number to the function. Loop over the array (nested for loops) and, if the number is found in
the bingo array, then change the value to 0 to "mark" it. If the number is found, then this function
should return true; otherwise, return false. PLEASE REMEMBER THAT YOU ARE NOT
ALLOWED TO USE IE tUEN TO STOP A LOOP. Create a function to check for a completed row.
A completed row is a row in the bingo array that has 0 for every value (we "marked" our bingo
numbers by changing the existing value to zero to indicate that the called number matches one in
our bingo card). This function should check every row in the bingo array and return whether or not
it found a completed row. Create a function to check for a completed column. A completed column
is a column in the bingo array that has 0 for every value (we "marked" our bingo numbers by
changing the existing value to zero to indicate that the called number matches one in our bingo
card). This function should check every column in the bingo array and return whether or not it
found a completed column. Create a function to check for a completed diagonal. A completed
diagonal is a diagonal in the bingo array that has 0 for every value (we "marked" our bingo
numbers by changing the existing value to zero to indicate that the called number matches one in
our bingo card). This function should check both diagonals in the bingo array and return whether
or not it found a completed diagonal. Add prototypes for the functions at the top of the program.
masin( Call function to fill bingo card Call function to print bingo card to screen While the player
has not won and while there are still numbers to choose from (there are 75 totall) Call a function to
pick a number that has not been chosen already-this function returns the called number. Show the
player the number (including the B,I,N,G or O ) and ask if the player has that number on their
bingo card. If the player answers anything other than something that begins with ' Y ', then reprint
the bingo card and increment the count of numbers drawn so far. I NOTE ; Your code must use
this prompt so that your code can easily be tested * / If the player answers something that begins
with , then Call a function to determine if the number drawn IS a number from the bingo card.

More Related Content

Similar to include ltstdiohgtinclude ltstdlibhgtinclude l.pdf

Practical File waale code.pdf
Practical File waale code.pdfPractical File waale code.pdf
Practical File waale code.pdf
FriendsStationary
 
#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf
aquacareser
 
#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf
aquapariwar
 
Aplikasi menghitung matematika dengan c++
Aplikasi menghitung matematika dengan c++Aplikasi menghitung matematika dengan c++
Aplikasi menghitung matematika dengan c++
radar radius
 
calculator_new (1).pdf
calculator_new (1).pdfcalculator_new (1).pdf
calculator_new (1).pdf
ni30ji
 
Ada file
Ada fileAda file
Ada file
Kumar Gaurav
 
AI_Lab_File()[1]sachin_final (1).pdf
AI_Lab_File()[1]sachin_final (1).pdfAI_Lab_File()[1]sachin_final (1).pdf
AI_Lab_File()[1]sachin_final (1).pdf
pankajkaushik2216
 
COA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdfCOA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdf
JavedAnsari236392
 
pointers 1
pointers 1pointers 1
pointers 1
gaurav koriya
 
PROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdfPROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdf
NakulSingh78
 
c++ #include -iostream- using namespace std- void InsertionSort(int nu.pdf
c++ #include -iostream- using namespace std- void InsertionSort(int nu.pdfc++ #include -iostream- using namespace std- void InsertionSort(int nu.pdf
c++ #include -iostream- using namespace std- void InsertionSort(int nu.pdf
kuldeepkumarapgsi
 
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
Mahmoud Samir Fayed
 

Similar to include ltstdiohgtinclude ltstdlibhgtinclude l.pdf (12)

Practical File waale code.pdf
Practical File waale code.pdfPractical File waale code.pdf
Practical File waale code.pdf
 
#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf
 
#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf#In this project you will write a program play TicTacToe #using tw.pdf
#In this project you will write a program play TicTacToe #using tw.pdf
 
Aplikasi menghitung matematika dengan c++
Aplikasi menghitung matematika dengan c++Aplikasi menghitung matematika dengan c++
Aplikasi menghitung matematika dengan c++
 
calculator_new (1).pdf
calculator_new (1).pdfcalculator_new (1).pdf
calculator_new (1).pdf
 
Ada file
Ada fileAda file
Ada file
 
AI_Lab_File()[1]sachin_final (1).pdf
AI_Lab_File()[1]sachin_final (1).pdfAI_Lab_File()[1]sachin_final (1).pdf
AI_Lab_File()[1]sachin_final (1).pdf
 
COA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdfCOA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdf
 
pointers 1
pointers 1pointers 1
pointers 1
 
PROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdfPROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdf
 
c++ #include -iostream- using namespace std- void InsertionSort(int nu.pdf
c++ #include -iostream- using namespace std- void InsertionSort(int nu.pdfc++ #include -iostream- using namespace std- void InsertionSort(int nu.pdf
c++ #include -iostream- using namespace std- void InsertionSort(int nu.pdf
 
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
 

More from adisainternational

Insert a function in cell D11 to display the ltem name based.pdf
Insert a function in cell D11 to display the ltem name based.pdfInsert a function in cell D11 to display the ltem name based.pdf
Insert a function in cell D11 to display the ltem name based.pdf
adisainternational
 
Insert Document To Collection nbdaproject36vents VIEW P.pdf
Insert Document To Collection nbdaproject36vents VIEW  P.pdfInsert Document To Collection nbdaproject36vents VIEW  P.pdf
Insert Document To Collection nbdaproject36vents VIEW P.pdf
adisainternational
 
innervates posterior 13 of tongue taste 2 Wordscran.pdf
innervates posterior 13 of tongue  taste  2 Wordscran.pdfinnervates posterior 13 of tongue  taste  2 Wordscran.pdf
innervates posterior 13 of tongue taste 2 Wordscran.pdf
adisainternational
 
Individually look for the Code of Conduct of a selected comp.pdf
Individually look for the Code of Conduct of a selected comp.pdfIndividually look for the Code of Conduct of a selected comp.pdf
Individually look for the Code of Conduct of a selected comp.pdf
adisainternational
 
Influenza is an infectious respiratory disease caused by a .pdf
Influenza is an infectious respiratory disease caused by a .pdfInfluenza is an infectious respiratory disease caused by a .pdf
Influenza is an infectious respiratory disease caused by a .pdf
adisainternational
 
Informacin general Anna ha estado hablando con los director.pdf
Informacin general Anna ha estado hablando con los director.pdfInformacin general Anna ha estado hablando con los director.pdf
Informacin general Anna ha estado hablando con los director.pdf
adisainternational
 
inflation in india interest rates in india and compare it wi.pdf
inflation in india interest rates in india and compare it wi.pdfinflation in india interest rates in india and compare it wi.pdf
inflation in india interest rates in india and compare it wi.pdf
adisainternational
 
Indigenous Peoples and Environmental Sustainability Article .pdf
Indigenous Peoples and Environmental Sustainability Article .pdfIndigenous Peoples and Environmental Sustainability Article .pdf
Indigenous Peoples and Environmental Sustainability Article .pdf
adisainternational
 
Information Security Problem a Give the public and private.pdf
Information Security Problem a Give the public and private.pdfInformation Security Problem a Give the public and private.pdf
Information Security Problem a Give the public and private.pdf
adisainternational
 
Infertility and Hypothyroidism Patient ProfileMB is a 29y.pdf
Infertility and Hypothyroidism Patient ProfileMB is a 29y.pdfInfertility and Hypothyroidism Patient ProfileMB is a 29y.pdf
Infertility and Hypothyroidism Patient ProfileMB is a 29y.pdf
adisainternational
 
inet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdf
inet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdfinet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdf
inet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdf
adisainternational
 
Indique el diagnstico ms preciso posible Luego indique la.pdf
Indique el diagnstico ms preciso posible Luego indique la.pdfIndique el diagnstico ms preciso posible Luego indique la.pdf
Indique el diagnstico ms preciso posible Luego indique la.pdf
adisainternational
 
In user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdfIn user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdf
adisainternational
 
include ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfinclude ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdf
adisainternational
 
In your opinion What would drive your decisions If you wer.pdf
In your opinion What would drive your decisions If you wer.pdfIn your opinion What would drive your decisions If you wer.pdf
In your opinion What would drive your decisions If you wer.pdf
adisainternational
 
Income statement for 2016 Sales are expected to increase by .pdf
Income statement for 2016 Sales are expected to increase by .pdfIncome statement for 2016 Sales are expected to increase by .pdf
Income statement for 2016 Sales are expected to increase by .pdf
adisainternational
 
Indicate in the figure below the location of the Stratosphe.pdf
Indicate in the figure below the location of the Stratosphe.pdfIndicate in the figure below the location of the Stratosphe.pdf
Indicate in the figure below the location of the Stratosphe.pdf
adisainternational
 
Independent ttest Dependentpaired ttest Oneway ANOVA Two.pdf
Independent ttest Dependentpaired ttest Oneway ANOVA Two.pdfIndependent ttest Dependentpaired ttest Oneway ANOVA Two.pdf
Independent ttest Dependentpaired ttest Oneway ANOVA Two.pdf
adisainternational
 
Independent Assortment Two genes Dumb d and Anxious a .pdf
Independent Assortment Two genes Dumb d and Anxious a .pdfIndependent Assortment Two genes Dumb d and Anxious a .pdf
Independent Assortment Two genes Dumb d and Anxious a .pdf
adisainternational
 
incubation limes that rimake up the middle 97 Cick the icon.pdf
incubation limes that rimake up the middle 97 Cick the icon.pdfincubation limes that rimake up the middle 97 Cick the icon.pdf
incubation limes that rimake up the middle 97 Cick the icon.pdf
adisainternational
 

More from adisainternational (20)

Insert a function in cell D11 to display the ltem name based.pdf
Insert a function in cell D11 to display the ltem name based.pdfInsert a function in cell D11 to display the ltem name based.pdf
Insert a function in cell D11 to display the ltem name based.pdf
 
Insert Document To Collection nbdaproject36vents VIEW P.pdf
Insert Document To Collection nbdaproject36vents VIEW  P.pdfInsert Document To Collection nbdaproject36vents VIEW  P.pdf
Insert Document To Collection nbdaproject36vents VIEW P.pdf
 
innervates posterior 13 of tongue taste 2 Wordscran.pdf
innervates posterior 13 of tongue  taste  2 Wordscran.pdfinnervates posterior 13 of tongue  taste  2 Wordscran.pdf
innervates posterior 13 of tongue taste 2 Wordscran.pdf
 
Individually look for the Code of Conduct of a selected comp.pdf
Individually look for the Code of Conduct of a selected comp.pdfIndividually look for the Code of Conduct of a selected comp.pdf
Individually look for the Code of Conduct of a selected comp.pdf
 
Influenza is an infectious respiratory disease caused by a .pdf
Influenza is an infectious respiratory disease caused by a .pdfInfluenza is an infectious respiratory disease caused by a .pdf
Influenza is an infectious respiratory disease caused by a .pdf
 
Informacin general Anna ha estado hablando con los director.pdf
Informacin general Anna ha estado hablando con los director.pdfInformacin general Anna ha estado hablando con los director.pdf
Informacin general Anna ha estado hablando con los director.pdf
 
inflation in india interest rates in india and compare it wi.pdf
inflation in india interest rates in india and compare it wi.pdfinflation in india interest rates in india and compare it wi.pdf
inflation in india interest rates in india and compare it wi.pdf
 
Indigenous Peoples and Environmental Sustainability Article .pdf
Indigenous Peoples and Environmental Sustainability Article .pdfIndigenous Peoples and Environmental Sustainability Article .pdf
Indigenous Peoples and Environmental Sustainability Article .pdf
 
Information Security Problem a Give the public and private.pdf
Information Security Problem a Give the public and private.pdfInformation Security Problem a Give the public and private.pdf
Information Security Problem a Give the public and private.pdf
 
Infertility and Hypothyroidism Patient ProfileMB is a 29y.pdf
Infertility and Hypothyroidism Patient ProfileMB is a 29y.pdfInfertility and Hypothyroidism Patient ProfileMB is a 29y.pdf
Infertility and Hypothyroidism Patient ProfileMB is a 29y.pdf
 
inet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdf
inet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdfinet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdf
inet at pemoning Bret is Bhen the nol asd atenene irpuinise .pdf
 
Indique el diagnstico ms preciso posible Luego indique la.pdf
Indique el diagnstico ms preciso posible Luego indique la.pdfIndique el diagnstico ms preciso posible Luego indique la.pdf
Indique el diagnstico ms preciso posible Luego indique la.pdf
 
In user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdfIn user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdf
 
include ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfinclude ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdf
 
In your opinion What would drive your decisions If you wer.pdf
In your opinion What would drive your decisions If you wer.pdfIn your opinion What would drive your decisions If you wer.pdf
In your opinion What would drive your decisions If you wer.pdf
 
Income statement for 2016 Sales are expected to increase by .pdf
Income statement for 2016 Sales are expected to increase by .pdfIncome statement for 2016 Sales are expected to increase by .pdf
Income statement for 2016 Sales are expected to increase by .pdf
 
Indicate in the figure below the location of the Stratosphe.pdf
Indicate in the figure below the location of the Stratosphe.pdfIndicate in the figure below the location of the Stratosphe.pdf
Indicate in the figure below the location of the Stratosphe.pdf
 
Independent ttest Dependentpaired ttest Oneway ANOVA Two.pdf
Independent ttest Dependentpaired ttest Oneway ANOVA Two.pdfIndependent ttest Dependentpaired ttest Oneway ANOVA Two.pdf
Independent ttest Dependentpaired ttest Oneway ANOVA Two.pdf
 
Independent Assortment Two genes Dumb d and Anxious a .pdf
Independent Assortment Two genes Dumb d and Anxious a .pdfIndependent Assortment Two genes Dumb d and Anxious a .pdf
Independent Assortment Two genes Dumb d and Anxious a .pdf
 
incubation limes that rimake up the middle 97 Cick the icon.pdf
incubation limes that rimake up the middle 97 Cick the icon.pdfincubation limes that rimake up the middle 97 Cick the icon.pdf
incubation limes that rimake up the middle 97 Cick the icon.pdf
 

Recently uploaded

The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 

Recently uploaded (20)

The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 

include ltstdiohgtinclude ltstdlibhgtinclude l.pdf

  • 1. #include <stdio.h> #include <stdlib.h> #include <time.h> void FillBingoCard(int bingocard[5][5]); void PrintCard(int bingocard[5][5], int called[3], char yn[1]); int PickNumber(int called[3], int callednumber[75], int counter); int drawnnumber(int bingocard[5][5], int called[3]); void completedrowcolumn(int bingocard[5][5], int win); int main(void) { //array of bingo numbers int row = 5; int col = 5; int bingocard[row][col]; int called[3]; int counter = 0; int callednumber[75]; char yn[1]; int win = 0; //fill bingocard void FillBingoCard(int bingocard[5][5]) { int i, j, k; int temp; srand(time(NULL)); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { temp = rand() % 15 + 1 + j * 15; for (k = 0; k < j; k++) { if (temp == bingocard[i][k]) { j--; break; } }
  • 2. bingocard[i][j] = temp; } } bingocard[2][2] = -1; } void PrintCard(int bingocard[5][5], int called[3], char yn[1]) { int i, j; printf(" B I N G On"); for (i = 0; i < 5; i++) { printf("----------------------n"); for (j = 0; j < 5; j++) { if (bingocard[i][j] == -1) { printf("| X "); } else if (called[0] == 'B' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'I' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'N' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'G' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'O' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else { printf("| %2d", bingocard[i][j]);
  • 3. } } printf("|n"); } printf("----------------------n"); printf("Have you got number %c%d? (Y/N) ", called[0], called[1]); scanf(" %c", yn); } int PickNumber(int called[3], int callednumber[75], int counter) { int temp; srand(time(NULL)); do { temp = rand() % 75 + 1; } while (callednumber[temp - 1] != 0); callednumber[temp - 1] = 1; called[1] = temp; if (temp <= 15) { called[0] = 'B'; } else if (temp <= 30) { called[0] = 'I'; } else if (temp <= 45) { called[0] = 'N'; } else if (temp <= 60) { called[0] = 'G'; } else { called[0] = 'O'; } return *called;
  • 4. } int drawnnumber(int bingocard[5][5], int called[3]) { int row, col; int found = 0; for (row = 0; row < 5; row++) { for (col = 0; col < 5; col++) { if (bingocard[row][col] == called[1]) { bingocard[row][col] = -1; found = 1; } } } if (found == 1) { return 1; } else { return 0; } } { int row, col; // check for completed rows for (row = 0; row < 5; row++) { int count = 0; for (col = 0; col < 5; col++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) {
  • 5. printf("nBINGO! You completed row %d.", row + 1); win = 1; } } // check for completed columns for (col = 0; col < 5; col++) { int count = 0; for (row = 0; row < 5; row++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed column %d.", col + 1); win = 1; } } } void completedrowcolumn(int bingocard[5][5], int win) { int row, col, diag, count; // check for completed rows for (row = 0; row < 5; row++) { count = 0; for (col = 0; col < 5; col++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed row %d.", row + 1); win = 1; }
  • 6. } // check for completed columns for (col = 0; col < 5; col++) { count = 0; for (row = 0; row < 5; row++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed column %d.", col + 1); win = 1; } } // check for completed diagonal lines count = 0; for (diag = 0; diag < 5; diag++) { if (bingocard[diag][diag] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed the diagonal line from top left to bottom right."); win = 1; } count = 0; for (diag = 0; diag < 5; diag++) { if (bingocard[diag][4 - diag] == -1) { count++; } }
  • 7. if (count == 5) { printf("nBINGO! You completed the diagonal line from top right to bottom left."); win = 1; } if (win == 1) { printf("nCongratulations! You won!"); } } #include <stdio.h> #include <stdlib.h> #include <time.h> void FillBingoCard(int bingocard[5][5]); void PrintCard(int bingocard[5][5], int called[3], char yn[1]); int PickNumber(int called[3], int callednumber[75], int counter); int drawnnumber(int bingocard[5][5], int called[3]); void completedrowcolumn(int bingocard[5][5], int win); int main(void) { //array of bingo numbers int row = 5; int col = 5; int bingocard[row][col]; int called[3];
  • 8. int counter = 0; int callednumber[75]; char yn[1]; int win = 0; //fill bingocard void FillBingoCard(int bingocard[5][5]) { int i, j, k; int temp; srand(time(NULL)); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { temp = rand() % 15 + 1 + j * 15; for (k = 0; k < j; k++) { if (temp == bingocard[i][k]) { j--;
  • 9. break; } } bingocard[i][j] = temp; } } bingocard[2][2] = -1; } void PrintCard(int bingocard[5][5], int called[3], char yn[1]) { int i, j; printf(" B I N G On"); for (i = 0; i < 5; i++) { printf("----------------------n"); for (j = 0; j < 5; j++) { if (bingocard[i][j] == -1) { printf("| X "); }
  • 10. else if (called[0] == 'B' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'I' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'N' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'G' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else if (called[0] == 'O' && called[1] == bingocard[i][j]) { printf("| %2d", bingocard[i][j]); } else
  • 11. { printf("| %2d", bingocard[i][j]); } } printf("|n"); } printf("----------------------n"); printf("Have you got number %c%d? (Y/N) ", called[0], called[1]); scanf(" %c", yn); } int PickNumber(int called[3], int callednumber[75], int counter) { int temp; srand(time(NULL)); do { temp = rand() % 75 + 1; } while (callednumber[temp - 1] != 0); callednumber[temp - 1] = 1; called[1] = temp;
  • 12. if (temp <= 15) { called[0] = 'B'; } else if (temp <= 30) { called[0] = 'I'; } else if (temp <= 45) { called[0] = 'N'; } else if (temp <= 60) { called[0] = 'G'; } else { called[0] = 'O'; } return *called;
  • 13. } int drawnnumber(int bingocard[5][5], int called[3]) { int row, col; int found = 0; for (row = 0; row < 5; row++) { for (col = 0; col < 5; col++) { if (bingocard[row][col] == called[1]) { bingocard[row][col] = -1; found = 1; } } } if (found == 1) { return 1; }
  • 14. else { return 0; } } { int row, col; // check for completed rows for (row = 0; row < 5; row++) { int count = 0; for (col = 0; col < 5; col++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed row %d.", row + 1);
  • 15. win = 1; } } // check for completed columns for (col = 0; col < 5; col++) { int count = 0; for (row = 0; row < 5; row++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed column %d.", col + 1); win = 1; } }
  • 16. } void completedrowcolumn(int bingocard[5][5], int win) { int row, col, diag, count; // check for completed rows for (row = 0; row < 5; row++) { count = 0; for (col = 0; col < 5; col++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed row %d.", row + 1); win = 1; } }
  • 17. // check for completed columns for (col = 0; col < 5; col++) { count = 0; for (row = 0; row < 5; row++) { if (bingocard[row][col] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed column %d.", col + 1); win = 1; } } // check for completed diagonal lines count = 0; for (diag = 0; diag < 5; diag++)
  • 18. { if (bingocard[diag][diag] == -1) { count++; } } if (count == 5) { printf("nBINGO! You completed the diagonal line from top left to bottom right."); win = 1; } count = 0; for (diag = 0; diag < 5; diag++) { if (bingocard[diag][4 - diag] == -1) { count++; } } if (count == 5) {
  • 19. printf("nBINGO! You completed the diagonal line from top right to bottom left."); win = 1; } if (win == 1) { printf("nCongratulations! You won!"); } } * It should also include the lines, and mark any called numbers with 'X'. If a number called isn't on my card and I indicate 'Y' that yes, I do have it, it should print me a message saying that I cheated and end the game. It should be in C. If you help, please send a working code so that I can check with mine! The next number is 065 Do you have it? (Y/N)Y That value is not on your BINGo card - are you trying to cheat??For filling the card with unique numbers, you have to go through the BINGO card column by column (rather than row by row which is what we normally do for 2D arrays). Since the BINGO card has 5 columns, this would be a good place to use a for loop. Now, for each column (inside the for loop), you need to find 5 unique values that fit within the allowed range for that column. So, WHILE you haven't found all 5, get a random number in range, check if you have already gotten it in that column - if you have, throw it out and get another - if you haven't, put it in your BINGO card. So for the Oth column, your number needs to be 1-15 1st column, your number needs to be 1630 2nd column, your number needs to be 31-45 3 rd column, your number needs to be 46-60 4th column, your number needs to be 61-75Create a function to print the bingo card to the screen. You must match the formatting shown in the sample output. The bingo array must be passed to this function. Create a function to pick a number that has not already been chosen. You will need to use a 10 array to keep track of which numbers between 1 and 75 have been used so that you don't pick numbers that have already been called. If you randomly pick a number that was already called, then pick another. Continue this process until you find a number that has not been previously called. Print the number to the screen along with its corresponding letter. This function should return that value. Do NOT create an array of 75 unique numbers - pick one number at a time and ensure it has not already been used. Create a function to determine if a called number exists in the player's bingo card. Pass the bingo array and the number to the function. Loop over the array (nested for loops) and, if the number is found in the bingo array, then change the value
  • 20. to 0 to "mark" it. If the number is found, then this function should return true; otherwise, return false. PLEASE REMEMBER THAT YOU ARE NOT ALLOWED TO USE re turn TO STOP A LOOP. Create a function to check for a completed row. A completed row is a row in the bingo array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to zero to indicate that the called number matches one in our bingo card). This function should check every row in the bingo array and return whether or not it found a completed row. Create a function to check for a completed column. A completed column is a column in the bingo array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to zero to indicate that the called number matches one in our bingo card). This function should check every column in the bingo array and return whether or not it found a completed column. Create a function to check for a completed diagonal. A completed diagonal is a diagonal in the bingo array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to zero to indicate that the called number matches one in our bingo card). This function should check both diagonals in the bingo array and return whether or not it found a completed diagonal. Add prototypes for the functions at the top of the program. main() Call function to fill bingo card Call function to print bingo card to screen While the player has not won and while there are still numbers to choose from (there are 75 total) Call a function to pick a number that has not been chosen already - this function returns the called number. Show the player the number (including the B, I, N, G or O ) and ask if the player has that number on their bingo card. If the player answers anything other than something that begins with ' ', then reprint the bingo card and increment the count of numbers drawn so far. / N NOTE : Your code must use this prompt so that your code can easily be tested % Create a 2D array that will be your bingo card. The bingo card will ONLY be 55. Make sure your random numbers are truly random between program runs. Use srand () only once and not in a function or loop. Create a function to fill the bingo card with random numbers in the proper ranges. Pass your 2D bingo array to this function to be populated. Be sure to mark the free spot. The ' B ' column contains numbers between 1 and 15 The 'I' column contains numbers between 16 and 30 not hardcode any of the numbers in The ' N ' column contains numbers between 31 and 45 your BINGO card - every number The ' G ' column contains numbers between 46 and 60 should random and in the correct range. The ' O column contains numbers between 61 and 75 Just a reminder - BINGO numbers MUST be unique. You cannot have the same number in multiple cells of your BINGO card. The rules of BINGO state that every number is unique. Obtaining random numbers using rand () does NOT guarantee that each number is unique - YOU must check that each number is unique. If a number has already been used, then get another number. Use the formula we went over in class to obtain numbers in a range do not hardcode every range.Create a function to print the bingo card to the screen. You must match the formatting shown in the sample output. The bingo array must be passed to this function. Create a function to pick a number that has not already been chosen. You will need to use a 10 array to keep track of which numbers between 1 and 75 have been used so that you don't pick numbers that have already been called. If you randomly pick a number that was already called, then pick another. Continue this process until you find a number that has not been previously called. Print the number to the screen along with its corresponding letter. This function should return that value. Do NOT create an array of 75 unique numbers - pick one number at a time and ensure it has not already been used. Create a
  • 21. function to determine if a called number exists in the player's bingo card. Pass the bingo array and the number to the function. Loop over the array (nested for loops) and, if the number is found in the bingo array, then change the value to 0 to "mark" it. If the number is found, then this function should return true; otherwise, return false. PLEASE REMEMBER THAT YOU ARE NOT ALLOWED TO USE IE tUEN TO STOP A LOOP. Create a function to check for a completed row. A completed row is a row in the bingo array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to zero to indicate that the called number matches one in our bingo card). This function should check every row in the bingo array and return whether or not it found a completed row. Create a function to check for a completed column. A completed column is a column in the bingo array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to zero to indicate that the called number matches one in our bingo card). This function should check every column in the bingo array and return whether or not it found a completed column. Create a function to check for a completed diagonal. A completed diagonal is a diagonal in the bingo array that has 0 for every value (we "marked" our bingo numbers by changing the existing value to zero to indicate that the called number matches one in our bingo card). This function should check both diagonals in the bingo array and return whether or not it found a completed diagonal. Add prototypes for the functions at the top of the program. masin( Call function to fill bingo card Call function to print bingo card to screen While the player has not won and while there are still numbers to choose from (there are 75 totall) Call a function to pick a number that has not been chosen already-this function returns the called number. Show the player the number (including the B,I,N,G or O ) and ask if the player has that number on their bingo card. If the player answers anything other than something that begins with ' Y ', then reprint the bingo card and increment the count of numbers drawn so far. I NOTE ; Your code must use this prompt so that your code can easily be tested * / If the player answers something that begins with , then Call a function to determine if the number drawn IS a number from the bingo card.