Add to Favorites    Make Home Page 3732 Online  
 Language Categories  
 Our Services  

Home » C++ Home » Computer Graphics Home » logical discription of logial errors in graphics


Search Projects & Source Codes:

Title logical discription of logial errors in graphics
Author balaajee
Author Email v_r_balaajee
Description This program discribes logical errors in real; time graphics
Category C++ » Computer Graphics
Hits 364186
Code Select and Copy the Code
#include<iostream.h> #include<conio.h> #include<dos.h> #include<stdio.h> #include<graphics.h> #include<math.h> #include<string.h> #include<time.h> float main(void) { int*p1,*p2,*p; clock_t start,end; time_t t,t1; int z=0,z1=0; int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, ""); int r=0; int ch,x=10,y=350; int poly[100],poly1[100],variable1; setcolor(14); ellipse(100,105,180,0,10,15); ellipse(93,125,320,50,3,7); ellipse(105,125,130,270,3,7); ellipse(110,112,250,90,3,2); line(93,128,108,133); putpixel(100,120,4); poly[0]=105; poly[1]=105; poly[2]=103; poly[3]=108; poly[4]=101; poly[5]=109; poly[6]=101; poly[7]=111; poly[8]=100; poly[9]=108; poly[10]=98; poly[11]=108; poly[12]=96; poly[13]=111; poly[14]=96; poly[15]=119; poly[16]=88; poly[17]=113; poly[18]=89; poly[19]=105; poly[20]=105; poly[21]=105; setcolor(8); drawpoly(11,poly); setfillstyle(1,8); floodfill(94,108,8); setcolor(14); poly1[0]=105; poly1[1]=105; poly1[2]=103; poly1[3]=108; poly1[4]=101; poly1[5]=109; poly1[6]=101; poly1[7]=111; poly1[8]=100; poly1[9]=108; poly1[10]=98; poly1[11]=108; poly1[12]=96; poly1[13]=111; poly1[14]=96; poly1[15]=119; drawpoly(8,poly1); line(105,105,110,105); setfillstyle(1,14); floodfill(106,110,14); floodfill(111,112,14); setcolor(2); for(variable1=0;variable1<=5;variable1+=2) ellipse(100,101,0,180,10,variable1); setcolor(4); for(variable1=0;variable1<=5;variable1+=3) ellipse(100,105,0,180,20,variable1); line(80,105,120,105); setfillstyle(1,0); fillellipse(107,111,1,2); setcolor(0); arc(107,111,70,160,3); setcolor(6); setfillstyle(1,6); fillellipse(99,112,1,3); setfillstyle(1,4); fillellipse(99,115,2,2); setcolor(8); for(variable1=0;variable1<=3;variable1++) ellipse(107,118,70,180,4,variable1); setcolor(4); line(93,128,108,133); line(108,133,110,138); line(110,138,93,133); line(93,133,93,128); setfillstyle(2,4); floodfill(96,131,4); setcolor(2); ellipse(100,193,20,70,15,60); ellipse(101,184,120,170,15,60); line(93,133,105,137); line(86,174,114,173); setfillstyle(1,2); floodfill(90,170,2); setcolor(3); line(104,140,102,150); line(94,140,94,151); line(94,140,103,140); line(100,150,108,165); line(100,165,108,165); line(94,151,100,165); setcolor(14); line(102,166,107,166); line(103,168,109,168); line(102,166,103,168); line(107,166,109,168); setfillstyle(1,14); floodfill(105,167,14); setcolor(0); line(102,169,110,169); setfillstyle(9,2); floodfill(100,145,3); setcolor(12); getimage(78,95,122,202,p1); line(108,175,106,195); line(92,175,94,195); line(108,175,92,175); line(106,195,94,195); setfillstyle(6,12); floodfill(100,180,12); setcolor(8); setfillstyle(6,8); ellipse(103,200,0,180,10,3); line(93,200,113,200); floodfill(103,199,8); getimage(78,95,122,202,p2); putimage(78,95,p2,1); putimage(78,95,p1,1); setcolor(12); setfillstyle(6,12); int po[100],pol[100]; po[0]=110; po[1]=174; po[2]=120; po[3]=196; po[4]=108; po[5]=196; po[6]=96; po[7]=174; po[8]=110; po[9]=174; drawpoly(5,po); pol[0]=96; pol[1]=174; pol[2]=89; pol[3]=174; pol[4]=87; pol[5]=196; pol[6]=97; pol[7]=196; pol[8]=101; pol[9]=184; drawpoly(5,pol); floodfill(103,177,12); floodfill(93,177,12); setcolor(8); setfillstyle(6,8); ellipse(119,200,0,180,10,3); ellipse(97,200,0,180,10,3); line(109,200,129,200); line(107,200,87,200); floodfill(119,199,8); floodfill(97,199,8); getimage(78,95,130,202,p1); putimage(78,95,p1,1); putimage(x-5,350,p1,1); setcolor(15); rectangle(0,458,getmaxx()+10,getmaxy()); setfillstyle(6,15); floodfill(10,464,15); setfillstyle(6,15); fillellipse(400,100,60,40); int v=0,v1=0,v2[1000],l1,l2,l3; int w1=0,w2,w3=20,w4; here1: delay(90); setcolor(0); setfillstyle(1,10); w2=sqrt(abs(w3*w3-w1*w1)); fillellipse(w1,w2,w3,w3); w1++; if(w1==getmaxx()+12) w1=0; while(kbhit()) ch=getch(); if(ch== 77) { x=x+5; //sound(3000); } else if (ch== 72) { v=350; for(int i=y,j=y-200,k=y+107;i>=y-200;i-=4,j+=4,k--) { if(i>=250) { if(x%2==0) { //sound(i+100); if(w1==getmaxx()+12) w1=0; fillellipse(w1,w2,w3,w3); w1++; delay(15); if(i==y) putimage(x,i+4,p1,1); putimage(x,i+4,p1,1); putimage(x,i,p1,2); if(!kbhit()) z = 10; while(kbhit()) { z+=2; if (z>100)break; v2[i]=getch(); delay(15); switch(v2[i]) { case 77: x=x+10; putimage(x,i,p1,1); putimage(x-10,i,p1,1); break; case 75: x=x-10; putimage(x,i,p1,1); putimage(x+10,i,p1,1); break; case 32: l2=i; for(l1=x+50;l1<=getmaxx();l1++) { while(kbhit()) { int t = getch(); switch(t) { case 77: x=x+10; putimage(x,i,p1,1); putimage(x-10,i,p1,1); break; case 75: x=x-10; putimage(x,i,p1,1); putimage(x+10,i,p1,1); break; } } delay(3); setcolor(0); setfillstyle(1,4); fillellipse(l1-2,l2,5,5); if(!kbhit())ungetch(t); } default: break; case 27: goto here2; } } ungetch(v2[i]); } else { ////sound(i+100); delay(15); if(i==y) putimage(x,i+4,p2,1); putimage(x,i+4,p2,1); putimage(x,i,p2,2); if(!kbhit()) z = 10; while(kbhit()) { z+=2; if (z>100)break; v2[i]=getch(); delay(15); switch(v2[i]) { case 77: x=x+10; putimage(x,i,p2,1); putimage(x-10,i,p2,1); break; case 75: x=x-10; putimage(x,i,p2,1); putimage(x+10,i,p2,1); break; case 32: default: break; case 27: goto here2; } } ungetch(v2[i]); } } if(i<250) { if(x%2==0) { ////sound(j+100); delay(15); if(j==y) putimage(x,i-4,p,1); putimage(x,j-4,p1,1); putimage(x,j,p1,2); } else { ////sound(i+100); delay(15); if(j==y) putimage(x,i-4,p,1); putimage(x,j-4,p2,1); putimage(x,j,p2,2); } } } } else if (ch== 75) { x=x-5; ////sound(3000); } else if (ch== 27) goto here2; else goto here; if(ch==77||ch==75) { if(x%2==0) { if(r==1) { if(ch==77) putimage(x-5,y,p2,1); if(ch==75) putimage(x+5,y,p2,1); } putimage(x,y,p1,1); } else { if(r==1) { if(ch==77) putimage(x-5,y,p1,1); if(ch==75) putimage(x+5,y,p1,1); } if(r==0) putimage(x-10,350,p1,1); putimage(x,y,p2,1); } r=1; } here: nosound(); ch=0; goto here1; here2: nosound(); }

Related Source Codes

Script Name Author
Moving ball screen saver karlmarx
The Classic Game of Snake & Ladder Lakshmi Narayana .A
Railway seat reservation question which comes in sapient VyomWorld
To calculate percentile Ravi Mathur
Send to folder ANIMESH SAHU
Analog clock and calendar Nazia & Rida
Data structure (stack Implimentation) Swapnil B Adsure
Memory Game AnirudhSanyal
Easy Calc Anirudh Sanyal
GK Quiz Anirudh Sanyal
Hangman Game Manish Jain
Snakeman Manish Jain
Full month Calendar Nigi
Cursor shapes nigi


Google Groups Subscribe to SourceCodesWorld - Techies Talk

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page


Google Search


Source Codes is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024, All Rights Reserved.
Page URL:

Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review