Hello. I have been designing a dice game program that calls for a playet to roll seven dice, each of which results in a value 1 through 6.
The scoring should be that:
-A triple (any 3 or more dice with identical values) scores 100 times the face value
except for three ones which score as 1,000 points.
-If two triples are scored, the score will be 150 times the face value of each,
except for three ones which score as 900 points.
then if no triple is rolled, then each “1" scores 100 points and/or each "5" scores 50 points.
-The game ends when one player scores 10,000 or more points. However, all players should
be able to complete the last turn, and therefore more than one player could score over 10,000 points. The player with the highest score wins. If more than one player matches high
score, it is a tie.
This is what i came up with Im not sure how to apply the scoring method at the end of seven runs. Your input is greatly appreciated
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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
#include <time.h>
#include <iostream>
#include <cstdlib>
using namespace std;
int dice1, dice2 = 0;
void RollDice(); // The Void Program That Rolls The Dice
int main()
{
srand(time(0));
int input = 1;
do
{
if (input == 1)
{
system ("Pause");
RollDice(); // Function That Does Everything For The Code
cout << " Press 1 to Roll and 2 to Quit :";
}
else if (input !=1 || input != 2)
{
cout << "Input Again:"<<endl;
}
cin >> input;
}
while(input!=2);
return 1;
}
void RollDice()
{
dice1 = (rand()%6+1); // 1-6 Numbers
dice2 = (rand()%6+1); // To Make It Different It Multiplies By 13
switch(dice1) //Switch Statement That Has All The Possible Outcomes For Dice 1
{
case 1:
cout <<"player 1"<<endl;
cout <<endl;
cout << "[ . ] " <<endl;
break;
case 2:
cout <<"player 1"<<endl;
cout <<endl;
cout << "[ : ]" <<endl;
break;
case 3:
cout <<"player 1"<<endl;
cout <<endl;
cout << "[. :]" <<endl;
break;
case 4:
cout <<"player 1"<<endl;
cout <<endl;
cout << "[: :]" <<endl;
break;
case 5:
cout <<"player 1"<<endl;
cout <<endl;
cout << "[:.:]"<<endl;
break;
case 6:
cout <<"player 1"<<endl;
cout <<endl;
cout << "[:::]" <<endl;
break;
}
switch(dice2) //Same As Above Except For Dice 2
{
case 1:
cout <<"Player 2" <<endl;
cout <<endl;
cout << "[ . ]" <<endl;
break;
case 2:
cout <<"Player 2" <<endl;
cout <<endl;
cout << "[ : ]" <<endl;
break;
case 3:
cout <<"Player 2" <<endl;
cout <<endl;
cout << "[. :]" <<endl;
break;
case 4:
cout <<"Player 2" <<endl;
cout <<endl;
cout << "[: :]" <<endl;
break;
case 5:
cout <<"Player 2" <<endl;
cout <<endl;
cout << "[:.:]" <<endl;
break;
case 6:
cout <<"Player 2" <<endl;
cout <<endl;
cout << "[:::]" <<endl;
break;
}
}
|