#include <iostream>
#include <cstdlib>
#include <fstream>
usingnamespace std;
int main()
{
int die1=0;
int die2=0;
//counter for winners
int winner=0;
//counter for losers
int loser=0;
//counter for draw
int draw=0;
//func to determine the outcome
int outcome(int, int);
//func for random numbers
int rollDice();
cout <<"Enter Two Numbers To Play a Game Of Dice\n";
cin >> die1>> die2;
cout <<"You Entered : "<< die1<<" "<<die2<<endl;
while (die1>=1 && die2<=6) {
case 0: cout <<" You A Winner\n"; break;
case 1: cout <<" You A Loser\n"; break;
case 2: cout <<" A Draw\n"; break;
// to get the next two value
cin >> die1>> die2;
cout <<"You Entered : "<< die1<<" "<<die2<<endl;
}
return 0;
}
//function
int outcome(int, int)
{
int die1;
int die2;
if (die1+die2==5 || die1+die2==7 || die1+die2==12)
return 0;
if (die1+die2==2 || die1+die2==4 || die1+die2==11)
return 1;
elsereturn 2;
}
// func to get a random number
int rollDice()
{
int roll;
roll = (rand()%6)+1;
return roll;
}
#include <iostream>
#include <cstdlib>
#include <fstream>
// Function declarations here
int outcome(int, int);
int rollDice();
// Begin main
int main()
{
int roll01 = rollDice(); // must declare a variable
int roll02 = rollDice();
int result = outcome(roll01, roll02);
// Do stuff with result
return 0;
}
// Function definitions
int outcome(int, int)
{
int whatHappned;
// stuff
return whatHappend;
}
int rollDice()
{
return 5; // I picked it randomly :)
}
Also, please put the code tags around your code (via the <> button to the right of the post box).