Need help creating a Bingo Program in C++!?
I need to create a program that plays bingo in C++. I'm not too sure how to go about it since I'm fairly new to C++ but here's what I have so far.
#include <iostream>
#include <ctime>
using namespace std;
int main () {
int bingo[5][5], b[1][5], i[1][5], n[1][5], g[1][5], o[1][5];
for (int y=0; y < 1; y++)
{
for (int x=0; x < 1 ; x++)
{
cout << "B" << " " << "I" << " " << "N" << " " << "G" << " " << "O";
}
cout << endl;
}
for (int y=0; y < 5; y++)
{
for (int x=0; x < 1; x++)
{
for (int x=0; x < 1; x++)
{
b[x][y] = rand()%15+1;
}
for (int x=0; x < 1; x++)
{
i[x][y] = rand()%15+16;
}
for (int x=0; x < 1; x++)
{
n[x][y] = rand()%15+31;
}
for (int x=0; x < 1; x++)
{
g[x][y] = rand()%15+46;
}
for (int x=0; x < 1; x++)
{
o[x][y] = rand()%15+61;
}
cout << b[x][y] << " " << i[x][y] << " " << n[x][y] << " " << g[x][y] << " " << o[x][y] << " ";
}
cout << endl;
}
What are you finding is wrong with your code?
It appears that you want to produce a bingo board and display it. Is that right?
If so, the following may work a bit better:
Well now what I was having trouble with is that I need to create some way that the program actually plays the game. I understand that in order to do that, I should create a random number generator however, I'm not quite sure how to create a sort of a marker that would let you know that that number has been called or not.
I'm sorry, I wasn't quite sure where to post this =\