#include <cstdlib>
#include <ctime>
#include <curses.h>
#include "bingo1.h"
int main() {
Number card[BOARD_WIDTH][BOARD_WIDTH];
int line;
int x;
initscr();
start_color();
init_pair(1, COLOR_BLACK, COLOR_YELLOW);
time_t t = time(NULL);
srand(t);
initCard(card);
while (true) {
line = showCard(card);
if (line >= LINE_THRESHOLD)
break;
x = getNumber();
check(card, x);
}
showMessage("Bingo!");
getch();
endwin();
return 0;
}
#define BOARD_WIDTH 5
#define LINE_THRESHOLD 3
#define MAX_NUMBER 75
struct Number {
int value;
bool match;
};
void initCard(Number card[][BOARD_WIDTH]);
int showCard(Number card[][BOARD_WIDTH]);
int getNumber();
void showMessage(char* s);
void check(Number card[][BOARD_WIDTH], int x);