Exemple #1
0
void PlayerBox::resizeEvent(QResizeEvent* e)
{
  QGroupBox::resizeEvent(e);

  showCash();
  showName();
}
getwin() {
	if(a == b && b == c && c == d) { //jackpot!
		printf("\nCongragulations! You won: $1000!\n");
		tot_cash = tot_cash + 1000;
		showCash();
		printf("Acheivement Get: Hit It Big!\n");
		again = 'x';
		while(again != 'y' || again != 'Y' || again != 'n' || again != 'N') {
			printf("\nWould you like to re-roll? (Y/N)  ");
			scanf("%c",&again);
			if(again == 'y' || again == 'Y') {
				roll();
				getwin();
			}
			if(again == 'n' || again == 'N') {
				sleep(1);
				exit;
			}
		}
		
	}
	if(a == b && b == c || b == c && c == d) { //3-in-row
		printf("\nCongragulations! You won: $500!\n");
		tot_cash = tot_cash + 500;
		showCash();
		again = 'x';
		while(again != 'y' || again != 'Y' || again != 'n' || again != 'N') {
			printf("\nWould you like to re-roll? (Y/N)  ");
			scanf("%c",&again);
			if(again == 'y' || again == 'Y') {
				roll();
				getwin();
			}
			if(again == 'n' || again == 'N') {
				exit;
			}
		}
	}
	if(a == c && b == d) { //1st number = 3rd number and 2nd number = 4th number
		printf("\nCongragulations! You won: $750!\n");
		tot_cash = tot_cash + 750;
		showCash();
		again = 'x';
		while(again != 'y' || again != 'Y' || again != 'n' || again != 'N') {
			printf("\nWould you like to re-roll? (Y/N)  ");
			scanf("%c",&again);
			if(again == 'y' || again == 'Y') {
				roll();
				getwin();
			}
			if(again == 'n' || again == 'N') {
				sleep(1);
				exit;
			}
		}
	}
	else { //whoops! no matches.
		printf("\nThe numbers don't match! Try again.\n");
		showCash();
		again = 'x';
		printf("Insert another coin? (Y or N)");
		scanf("%c",&choice);
		again = 'x';
		while(again != 'y' || again != 'Y' || again != 'n' || again != 'N') {
			printf("\nWould you like to re-roll? (Y/N)  ");
			scanf("%c",&again);
			if(again == 'y' || again == 'Y') {
				roll();
				getwin();
			}
			if(again == 'n' || again == 'N') {
				sleep(1);
				exit;
			}
		}
	}
}