Example #1
0
 void tests(){
     cerr << "#open blackjack ";
     cerr << (blackjack({1, 13}) == 21);
     cerr << (blackjack({11, 13}) == 20);
     cerr << (blackjack({1, 1, 1}) == 13);
     cerr << (blackjack({1, 1, 2, 3, 12}) == 17);
     cerr << (blackjack({1, 1, 2, 10, 12}) == 24);
 }
Example #2
0
void main()
{
	int total=100;
	char choice;
	clrscr();
	cout << "Crappy program gambling game";
	gotoxy(12,12);
	cout << "Press any key to get on da street";
	getch();
	while(choice!='Q')
	{
		clrscr();
		cout << "Dollars : " << total << endl;
		cout << "(C)raps" << endl << "(B)lackjack" << endl << "(R)oulette" << endl << "(S)lots" << endl << "(Q)uit";
		choice=getch();
		choice=toupper(choice);
		switch(choice)
		{
			case('C'):
			{
				clrscr();
				total=craps(total);
				break;
			}
			case('B'):
			{
				clrscr();
				total=blackjack(total);
				break;
			}
			case('Q'):
			{
				clrscr();
				quit(total);
				getch();
				break;
			}
			case('R'):
			{
				clrscr();
				total=roulette(total);
				break;
			}
			case('S'):
			{
				total=slots(total);
				break;
			}
		}
	}
}