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
|
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int die1();
int die2();
int dice (int, int);
int x, D, S;
int main()
{
}
//This function traverses the array of character (pass-in argument) and initializes each element to ‘E’. There is a total of 12 elements. This 12 elements form the board game.
void initializeBoard(char[12])
{
int number[12] = {1,2,3,4,5,6,7,8,9,10,11,12};
}
//This function traverses the array of character (pass-in argument) and displays each element on the board.
void displayBoard(char [12])
{
}
//This function traverses the array of character (pass-in argument) and accumulates the score if it is not being removed
int scoreGame(char[])
{
}
//This function takes in the choice (D or S) and the two dice numbers and the board as input arguments. When the move is legal and the tile is available for removal, it removes the tile according to the choice by marking the tile as ‘X’. Returns true if the move is successful.
bool removeTile(char, int, int, char[])
{
}
//The following function outputs a basic greeting to the user, ask user to press enter 2 times to roll both die
void greeting(int pnum) {
if(pnum == 1) {
std::cout << "Please press \"ENTER\" to roll the die.";
} else {
std::cout << "Please press \"ENTER\" again to roll the second die.";
}
std::cin.ignore();
}
//The following function simulates a die roll
int dieroll(void)
{
int ran;
srand(time(NULL));
ran = rand()%6+1;
std::cout << "You rolled a " << ran << "." << std::endl;
return ran;
}
//The following adds the 1st and 2nd roll together "S"
int dice(int fdie, int sdie) {
std::cout << "Your total so far is: " << sdie + fdie << std::endl;
return sdie + fdie;
}
|