سفارش تبلیغ
صبا ویژن

رسم ماشین در c++

نظر


#include <iostream.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>
#include <stdlib.h>
int main()
{
int d=DETECT,m=0,i;
initgraph(&d,&m,"c:\\turboc3\\bgi");
for (i=0;i<580;i++){
line(105+i,50,160+i,50);
line(104+i,50,104+i,130);
line (160+i,50,180+i,100);
line (0+i,100,0+i,130);
line (30+i,100,0+i,100);
line (0+i,130,30+i,130);
line (180+i,100,180+i,130);
line (250+i,100,250+i,130);
circle(245+i,112,5);
line (68+i,130,200+i,130);
line (240+i,130,250+i,130);
line(30+i,100,250+i,100);
//st line:
line(0-i,190,155-i,190);
line(0-i,200,155-i,200);

line(200-i,190,355-i,190);
line(200-i,200,355-i,200);

line(400-i,190,555-i,190);
line(400-i,200,555-i,200);

line(600-i,190,755-i,190);
line(600-i,200,755-i,200);

line(800-i,190,955-i,190);
line(800-i,200,955-i,200);


line(1000-i,190,1155-i,190);
line(1000-i,200,1155-i,200);


line(1200-i,190,1355-i,190);
line(1200-i,200,1355-i,200);


line(1400-i,190,1555-i,190);
line(1400-i,200,1555-i,200);
putpixel(123+i,80,15);
circle(120+i,80,8);
circle(120+i,80,8);
circle(85+i,78,8);
circle(70+i,91,8);
circle(96+i,91,8);
circle(50+i,134,17);
circle(220+i,134,17);
    for(int s=0;s<480;s+=45){
 pieslice (50+i,134,0+s,45+s,13);
 pieslice (50+i,134,90+s,135+s,13);
 pieslice (220+i,134,0+s,45+s,13);
 pieslice (220+i,134,90+s,135+s,13);
 pieslice (50+i,134,270+s,315+s,13);
  }

delay(1);
cleardevice();
 }
cout<<"MEISAM- http://ssblueroom.parsiblog.com";
getch();

closegraph();
}