SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
#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.

Más contenido relacionado

Similar a include ltstdiohgtinclude ltstdlibhgtinclude l.pdf

Practical File waale code.pdf
Practical File waale code.pdfPractical File waale code.pdf
Practical File waale code.pdfFriendsStationary
 
#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.pdfaquacareser
 
#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.pdfaquapariwar
 
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).pdfni30ji
 
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).pdfpankajkaushik2216
 
COA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdfCOA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdfJavedAnsari236392
 
PROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdfPROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdfNakulSingh78
 
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.pdfkuldeepkumarapgsi
 
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 212Mahmoud Samir Fayed
 

Similar a 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
 

Más de 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.pdfadisainternational
 
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.pdfadisainternational
 
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.pdfadisainternational
 
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.pdfadisainternational
 
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 .pdfadisainternational
 
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.pdfadisainternational
 
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.pdfadisainternational
 
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 .pdfadisainternational
 
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.pdfadisainternational
 
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.pdfadisainternational
 
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 .pdfadisainternational
 
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.pdfadisainternational
 
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.pdfadisainternational
 
include ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfinclude ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfadisainternational
 
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.pdfadisainternational
 
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 .pdfadisainternational
 
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.pdfadisainternational
 
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.pdfadisainternational
 
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 .pdfadisainternational
 
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.pdfadisainternational
 

Más de 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
 

Último

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Último (20)

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

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.