the one game - #include #include ...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream.h> #include <time.h> #include<comm.h> #include<process.h> #include<ctype.h> #include<dos.h> #include<conio.h> /************************** SEC 1: GLOBAL******************************************/ void init_mm( ) void gencard() void play() void about() void help() int noanim = 0 int number_range( int from, int to ) int number_mm( void ) staticintrgiState[2+55] int number,suit char faceace,soot /*****************************SEC 2. MAIN***********************************************/ void main() { char a clrscr() textcolor(WHITE) clrscr() if(noanim == 0) { for(int i=0 {sound(400) *" for(i=0 {sound(500) *" for(i=0 {sound(400) *" for(i=0 {sound(1000) *" } for( { clrscr() cout<<" C++ BLACKJACK" cout<<"
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 MENU" cout<<" 1. NEW GAME" cout<<" 2. ALL ABOUT BLACKJACK" cout<<" 3. ABOUT THE PROGRAM" cout<<" 4. EXIT" cout<<" PLEASE MAKE YOUR CHOICE" a=getch() if(a == '1') {sound(1000) else if(a == '2') {sound(1000) else if(a == '3') {sound(1000) else if(a == '4') {sound(1000) else { sound(400) cout<<" INCORRECT CHOICE" delay(500) } } } /***********************************SEC 4: GAMEPLAY**************************************************/ void play() { long bet int sum1,sum2,b1,b2 int value long money=10000 int doubledown int iter char f rb: b1=0 b2=0 sum1=0 sum2=0
Background image of page 2
Sheet1 Page 3 iter = 0 doubledown=0 clrscr() cout<<" AFTER YOUR FIRST TWO CARDS HAVE BEEN DEALT, PRESS: H TO HIT S TO STAND D TO DOUBLE DOWN" cout<<" You have a total of $ "<<money cout<<" Enter your bet(not exceeding $ 5000) $ " cin>>bet if(bet>5000) {cout<<" NOT exceeding 5000!" else if(bet<=0) {cout<<" INVALID BET!" else if(bet>money) {cout<<" You don't have enough money!" char a int acecheck = 0 int prem=0 cout<<" -->Dealer's First card:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 4 <<faceace<< "<<soot<<" (Dealer's Total: "<<sum2<<" )" <<number<< "<<soot<<" (Dealer's Total: "<<sum2<<" )" -->Your first two cards: ; gencard(); switch(number) { case 1: {value = 11; acecheck = 1;}break; case 11: {value = 10; acecheck = 0;}break; case 12: {value = 10; acecheck = 0;}break; case 13: {value = 10; acecheck = 0;}break; } if(number == 1 || number >10) sum2+=value; else sum2+=number; { sum2-=value; value = 1; sum2+=value; } if(number==1 || number>10) cout<<
Background image of page 4
Sheet1 Page 5 <<faceace<< "<<soot<<" (Your Total: "<<sum1<<" )" <<number<< "<<soot<<" (Your Total: "<<sum1<<" )" BLACKJACK!" sound(1000) sound(800) sound(600) sound(400) iter = -1 goto bj } if(sum1>21) { cout<<" BUSTED!" sound(400) delay(50) ; for(;;) { h: gencard(); switch(number) { case 1: {value = 11; acecheck = 1;}break; case 11: {value = 10; acecheck = 0;}break; case 12: {value = 10; acecheck = 0;}break; case 13: {value = 10; acecheck = 0;}break;
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Page1 / 56

the one game - #include #include ...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online