投骰子的随机游戏 这样写了之后输入1和2能正常运行,但输入其他的数字作为种子一直计算 运行错误

#include <iostream>
using namespace std;
#include <cstdlib>




int main()
{
	int sum,mypoint;
	enum gamestatus {WIN,LOSE,PLAYING};
    gamestatus status;
	unsigned seed;
	int rolldice();
	cout<<"输入一个随机数字:";
	cin>>seed;
	srand(seed);
	sum=rolldice();
	switch (sum)
	{
	case 7:
	case 11:
		status=WIN;
		break;
	case 2:
	case 3:
	case 12:
		status=LOSE;
		break;
	default:
		status=PLAYING;
		mypoint=sum;
		cout<<"点数是"<<mypoint<<endl;
		break;
	}
	while (status==PLAYING)
		sum=rolldice();
	if(sum==mypoint)
		status=WIN;
	else if(sum==7)
		status=LOSE;
	if (status==WIN)
		cout<<"WIN"<<endl;
	else 
		cout<<"LOSE"<<endl;
	return 0;

}

int rolldice()
{

	int die1=rand()%6+1;
	int die2=rand()%6+1;
	int sum=die1+die2;
	cout<<"总点数为"<<die1<<"+"<<die2<<"="<<sum;
	return sum;
}

显示mypoint 没有初始值,加了初始值后还是出错误

 

	while (status==PLAYING)
		sum=rolldice();

这句导致死循环了,一直在调用