hello
what is the problem in this program?
It doesn't pause.
#include "stdafx.h"
#include<iostream>
#include<ctime>
using namespace std;
int rolldice();
int _tmain(int argc, _TCHAR* argv[])
{
enum status{WON,LOST,CONTINUE};
int sumofdice,mypoint;
status gamestatus;
srand(time(0));
sumofdice=rolldice();
switch(sumofdice)
{
case 7:
case 11:
gamestatus=WON;
break;
case 2:
case 3:
case 12:
gamestatus=LOST;
break;
case 4:
case 5:
case 6:
case 8:
case 9:
case 10:
gamestatus=CONTINUE;
mypoint=sumofdice;
cout<<"my point is:"<<mypoint;
break;
}
while(gamestatus=CONTINUE)
{
sumofdice=rolldice();
if(sumofdice=mypoint)
gamestatus=WON;
else
if(sumofdice=7)
gamestatus=LOST;
This doesn't check for a condition, this assigns the value CONTINUE to gamestatus. For checking conditions you need the == operator, like this: while ( gamestatus == CONTINUE ). And if you post code, please select it and press the <> button (then it gets formatted).