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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/******************************************
A *
C *
H *
4/8/2018/ *
******************************************/
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
int main()
{
//functions
int beginGame(int playedBoard[]);
void displayBoard(int board[][3]);
bool testWinner(int ans, int boardNum, int ansBoard);
void instructions();
instructions();
beginGame(playedBoard);
displayBoard(board);
//
const int max_amount_of_guesses = 3;
int guessesMade = 0;
do
{
//AskForGuess();
guessesMade++;
} while (guessesMade < max_amount_of_guesses);
}
int beginGame(int playedBoard[])
{
//constants for the number of rows and columns
//understood this part
const int row_size = 4;
const int col_size = 3;
int boardNum1[row_size][col_size] = { { 90, 9 , 45 },
{ 66, 12, 48 },
{ 34, 7 , 70 },
{ 44, NULL , 26 } };
int boardNum2[row_size][col_size] = { { 28, 10, 55 },
{ 89, 17, 98 },
{ 22, 4 , 31 },
{ 69, NULL , 78 } };
int boardNum3[row_size][col_size] = { { 38, 11, 83 },
{ 15, 6 , 33 },
{ 11, 2 , 20 },
{ 86, NULL , 95 } };
int ansBoard[3] = { 8, 15, 14 };
int usedBoards[3] = { NULL };
//this will allow a random board to be genterated on the board
int maxValue = 3;
int minValue = 1;
int random_board_number = (rand() % (maxValue - minValue + 1)) + minValue;
bool testWinner(random_board_number);
}
bool testWinner(int ans, int boardNum[], int ansBoard[])
{
//when the user wins boardNum[random_board_number]=true
int current_guess = 0;
int guess_count = 0;
if (boardNum[0] && boardNum[1] && boardNum[2] == true)
{
cout << "You are the winner!" << endl;
}
}
void displayBoard(int board[][3])
{
//this will be used to place the question marks in the display board
}
void instructions ()
{
//this will display the welcome and instructions
cout << "**********************************************************";
cout << " MISSING NUMBERS GAME ";
cout << " A fun brain game... \n ";
cout << " Please enter a whole number to guess the missing number ";
cout << " Program Developed by: ";
cout << "**********************************************************";
}
|