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
|
#include <iostream>
#include <time.h>
#include <windows.h>
#include <cstdlib>
using namespace std;
int main
{
int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,y,z; //This allows for many players
//and many different variables
a = 1
while (a == 1)
{
system ("CLS");
cout << "Player One roll the dice, or pass your turn." << endl <<"1 - Roll" << endl << "2 - Pass Turn" << endl;
cin >> b
if (b == 1)
{
system ("CLS");
srand((unsigned)time(NULL));
c = (rand() %6) +1; //you can change the number
//after the % to account for a die
//with a different number of sides
cout << "Player One rolled" << c;
system ("pause"); //This keeps the program from
// immediately jumping to player two
a = 2;
}
else if (b == 2)
{system ("CLS");
cout << "Player One passes.";
system (pause);
a = 2}
else
{system ("CLS");
cout<< "Come on Player One, get with the program!";
system (pause);
}
}
}
|