card swapping - Code : #include<graphics.h>...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 Code : #include<graphics.h> #include<dos.h> #include<conio.h> #include<stdio.h> #include<iostream.h> const int clubs=0 const int diamonds=1 const int hearts=2 const int spades=3 const int jack=11 const int queen=12 const int king=13 const int ace=14 struct card { int number int suit } void main() { clrscr() card temp,chosen,prize char p,i=5,i1=3,i2=6,n int d,position,ch,x=100,x1=200,y=200,y1=350 int gd=DETECT,gm initgraph(&gd,&gm,"") card card1={7,clubs} //setcolor(1) //setbkcolor(4) do { settextstyle(TRIPLEX_FONT,0,3) outtextxy(100,50,"enter the level of the game?") cleardevice() cout<<" "<<i<<"7" outtextxy(200,300,"card1 is the 7 of clubs") card card2={jack,hearts} cout<<""<<i1<<"J" outtextxy(200,350,"card2 is jack of hearts") card card3={ace,spades}
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 cout<<""<<i2<<"A" outtextxy(200,400,"card3 is ace of spades") //setfillstyle(SOLID_FILL,14) //setcolor(1) //bar(100,100,200,250) //gotoxy(400,200) //bar(250,100,350,250) //bar(400,100,500,250) //rectangle(100,100,200,250) //rectangle(250,100,350,250) //rectangle(400,100,500,250) rectangle(100,100,200,200) rectangle(460,100,570,200) rectangle(270,100,370,200) prize=card3 while((ch=getch())!=' ) { switch(ch) { case'c': //cout<<" ; ; ;
Background image of page 2
Image of page 3
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 / 78

card swapping - Code : #include&lt;graphics.h&gt;...

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

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