prblem in craps

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;


}

if( gamestatus==WON)
cout<<"player wins.";
else
if(gamestatus==LOST)
cout<<"playe loses";


return 0;
}



int rolldice()
{
int die1,die2,sum;
die1=rand()%6+1;
die2=rand()%6+1;
sum=die1+die2;
cout<<"play rolled"<<die1<<"+"<<die2<<"="<<sum<<"\n";
return sum;
}
Last edited on
while(gamestatus=CONTINUE)

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).
thank you so much
Topic archived. No new replies allowed.