if ( gameStatus == WON ) //
display won or lost message
{
cout << "Player
wins" << endl;
}
else
{
cout << "Player
loses" << endl;
}
return 0;
// indicates successful termination
} // end main
// roll dice, calculate sum and
display results
int rollDice( void )
{
int die1 = 0, die2 = 0, workSum = 0;
die1 = 1 + rand() % 6; // pick random die1 value
die2 = 1 + rand() % 6; // pick random die2 value
workSum = die1 + die2; // sum
die1 and die2
// display results of this roll
cout << "Player
rolled " << die1 << "
+ " << die2
<< " = " <<
workSum << endl;
return workSum; // return sum of dice
} // End
function rollDice
Function rollDice
takes no arguments, so has void
in the parameter list.