Bingo Help!

Bingo is a game of chance. Each player takes a Bingo card. Each card has 25 spaces organized into
5 columns and 5 rows under the "BINGO" header, as follows:
• Each space has a value between 1 and 75 selected at random, except no two spaces on a card
can have the same value. The allowed range of values in each column is as follows:
B: 1-15, I: 16-30, N: 31-45, G: 46-60, and O: 61-75
Then during game play, values between 1 and 75 are selected at random, traditionally by placing
numbered balls in a basket and drawing them out one at a time. Once a number is selected, it must not
be selected again in the same game. If a number on a card is selected, the player covers the
corresponding space on the card. In addition, the center space (the third space down in the N column) is
called FREE and is always covered. A player wins the game by covering at least one of the following
patterns:
• All the spaces in any row.
• All the spaces in any column.
• All the spaces on either diagonal.
• The four corner spaces.
Write a C++ program that plays a simulation of an electronic Bingo game. Two players will play the
game.
• Have two program options. The first option is the demo mode- a demo mode is required so the
program can be graded. In demo mode, the user enters the bingo numbers (i.e. B2, O63, etc.).
Separate each value with a space when guessing (inputting to screen). This will allow you to test
your logic, results, etc. The second option is game mode. In this mode, the program will
randomly generate the bingo numbers.
• Generate and store two legal bingo cards. The middle square, the free square, is marked with an
X. The two cards are generated at start-up.
• Output the Bingo numbers called for each card.
• For both cards check if the bingo number is on the card, and if so- mark the cell with an X, and
check for a winning pattern listed above. Only one winning pattern per card.
• Continue playing until at least 1 player wins. Print a message congratulating the winner, the
winning card, and winning pattern (values).
At least one user-defined function must be used. Output should be user friendly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  #include <iostream>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;

int main()
{
	int card[5][5];
	int i, j, k, number;

	bool found = false;
	bool newnumber = false;

	srand(static_cast<unsigned>(time(NULL)));

	for (int x = 0; x < 2; x++)
	{
		cout << "Player " << (x + 1) << ":" << endl;
		cout << setw(2) << " B " << " I " << " N " << " G " << " O " << endl;
		for (i = 0; i < 5; i++)
		{
			for (j = 0; j < 5; j++)
			{
				newnumber = false;
				while (!newnumber)
				{
					found = false;
					number = (rand() % 15) + (i * 15) + 1;
					for (k = 0; k < 5; k++)
						if (card[k][i] == number)
							found = true;
					if (!found)
					{
						card[j][i] = number;
						newnumber = true;
					}
				}
			}
		}

		for (int i = 0; i < 5; i++)
		{
			for (int j = 0; j < 5; j++)
			{
				if (card[i][j] == card[2][2])
					cout << setw(3) << right << " X ";
				else
					cout << setw(2) << card[i][j] << " ";
			}
			cout << endl;
		}
		cout << endl;
	}



	cin.get();
	return 0;
}


Just trying to figure out how to cross the bingo numbers out!
Last edited on
Did you get this problem resolved? If so, how?
Sadly I have not, no one else has posted on this, and I was not really sure what to do or even how to go about it.
Topic archived. No new replies allowed.