{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

card swapping -...

Info icon This 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?") scanf("%d",&d) 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}
Image of page 1

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

View Full Document Right 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<<" i'am swaping card1 & card3 ; //outtextxy(300,300,i'am swaping card1 & card3") ; //outtextxy(300,300,i'am swaping card1 & card2") ; //outtextxy(300,300,i'am swaping card2 & card3") ;
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern