Minggu, 29 Januari 2012

                                                               Listing Program Pascal

                                                                Membuat Helikopter


uses crt,graph;
const
        rangkaM :array[1..26] of word
        =(100,680,380,680,380,620,370,610,320,610,
          300,550,280,540,200,540,180,550,150,610,
          110,610,100,620,100,610);

        jendelaM1: array[1..8] of word
        =(180,550,188,550,180,608,149,608);

        jendelaM4 : array[1..8] of word
        =(300,550,321,608,290,608,280,550);


        jendelaM3 : array[1..8] of word
        =(275,550,285,608,225,608,220,550);

        jendelaM2 : array[1..8] of word
        =(210,550,215,608,188,608,190,550);

        bmprsM1 : array[1..8] of word
        =(380,650,381,682,350,682,350,650);

        bmprsM2 : array[1..8] of word
        =(100,650,120,650,120,682,100,682);

        bmprsM3 : array[1..8] of word
        =(100,630,110,630,110,645,100,645);

        bodyP1 : array[1..8] of word
        =(580,200,570,150,490,150,475,200);

        bodyP2 : array[1..6] of word
        =(600,250,900,155,600,400);

        jendela1 : array[1..8] of word
        =(490,250,570,250,568,310,480,320);

        jendela2 : array[1..8] of word
        =(575,245,570,400,460,400,485,245);

        kakiP1 : array[1..8] of word
        =(545,440,570,380,550,380,525,445);

        kakiP2 : array[1..8] of word
        =(445,480,470,380,450,380,425,475);

        kakiP3 : array[1..8] of word
        =(345,440,370,384,350,380,325,445);

        kakiP4 : array[1..8] of word
        =(620,480,635,475,610,380,590,384);

        pnttP : array[1..6] of word
        =(890,160,860,170,880,80);

        bling1 : array[1..8] of word
        =(255,35,260,30,735,180,740,175);


        bling2 : array[1..8] of word
        =(740,55,735,60,285,195,280,190);


var
        driver,mode,I   :integer;
        ukuran          : word;
        citra           : pointer;
begin
        clrscr;
        driver:=detect;
        initgraph(driver,mode,'');

        setcolor(yellow);
        setfillstyle(1,yellow);
        fillpoly(4,bling1);

        setcolor(yellow);
        setfillstyle(1,yellow);
        fillpoly(4,bling2);

        setcolor(red);
        setfillstyle(1,red);
        ellipse(450,450,0,360,200,10);
        floodfill(450,450,red);

        setcolor(red);
        setfillstyle(1,red);
        ellipse(470,480,0,360,200,10);
        floodfill(470,480,red);

        setcolor(blue);
        setfillstyle(1,blue);
        fillpoly(4,kakiP1);

        setcolor(blue);
        setfillstyle(1,blue);
        fillpoly(4,kakiP2);

        setcolor(blue);
        setfillstyle(1,blue);
        fillpoly(4,kakiP3);

        setcolor(blue);
        setfillstyle(1,blue);
        fillpoly(4,kakiP4);

        setcolor(lightCYAN);
        setfillstyle(1,lightCYAN);
        ellipse(500,300,0,360,200,120);
        floodfill(500,300,lightCYAN);

        setcolor(red);
        setfillstyle(1,red);
        ellipse(535,150,0,360,5,30);
        floodfill(535,150,red);

        setcolor(lightblue);
        setfillstyle(1,lightblue);
        fillpoly(4,bodyp1);

        setcolor(red);
        setfillstyle(1,red);
        fillpoly(3,pnttP);

        setcolor(lightblue);
        setfillstyle(1,lightblue);
        fillpoly(3,bodyp2);



        setcolor(red);
        setfillstyle(1,red);
        circle(535,120,15);
        floodfill(535,120,red);

        setcolor(lightblue);
        setfillstyle(2,black);
        fillpoly(4,jendela2);

        setcolor(yellow);
        setfillstyle(1,yellow);
        fillpoly(4,jendela1);

        setcolor(red);
        setfillstyle(1,red);
        ellipse(350,300,0,360,50,75);
        floodfill(350,300,red);


        setcolor(blue);
        setfillstyle(1,blue);
        circle(900,155,20);
        floodfill(900,155,blue);

        setlinestyle(3,5,100);
        line(950,100,850,200);

        setcolor(yellow);
        setfillstyle(1,yellow);
        circle(900,155,10);
        floodfill(900,155,yellow);

        setcolor(black);
        setfillstyle(1,black);
        circle(900,155,5);
        floodfill(900,155,black);

        setcolor(red);
        Setfillstyle(1,red);
        fillpoly(13,rangkaM);

        setcolor(blue);
        setfillstyle(1,blue);
        circle(150,670,25);
        circle(320,670,25);
        floodfill(150,670,blue);
        floodfill(320,670,blue);

        setcolor(black);
        setfillstyle(1,black);
        circle(150,670,10);
        circle(320,670,10);
        floodfill(150,670,black);
        floodfill(320,670,black);

        setcolor(blue);
        setfillstyle(1,blue);
        circle(360,630,12);
        floodfill(360,630,blue);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,jendelaM1);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,jendelaM2);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,jendelaM3);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,jendelaM4);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,bmprsM1);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,bmprsM2);

        setcolor(yellow);
        Setfillstyle(1,yellow);
        fillpoly(4,bmprsM3);

        ukuran :=imagesize(90,530,400,700);
        getmem(citra,ukuran);
        getimage(90,530,400,700,citra^);
        I:=90;
                repeat
                        putimage(I,530,Citra^,xorput);
                        I:=I+100;
                        putimage(I,530,Citra^,copyput);
                until keypressed;
                freemem(citra,ukuran);

        readln;
end.

                                                         Pascal Pemandangan


uses crt,graph;
const
      garispinggir1 : array [1..10] of word
      = (5,5,1010,5,1010,650,5,650,5,5);
      langit1 : array [1..10] of word
      = (5,5,5,200,1010,200,1010,5,5,5);
      langit2 : array [1..8] of word
      = (5,200,5,400,300,200,5,5);
      langit3 : array [1..12] of word
      = (300,200,330,230,360,210,600,400,800,200,300,200);
      langit4 : array [1..8] of word
      = (800,200,1010,400,1010,200,800,200);
      gunung1 : array [1..12] of word
      = (5,400,300,200,330,230,360,210,
        600,400,5,400);
      gunung2 : array [1..8] of word
      = (600,400,800,200,1010,400,600,400);
      tangga1 : array [1..10] of word
      = (5,650,300,650,300,630,5,630,5,650);
      tangga2 : array [1..10] of word
      = (5,630,270,630,270,610,5,610,5,630);
      tangga3 : array [1..10] of word
      = (5,610,240,610,240,590,5,590,5,590);
      tangga4 : array [1..10] of word
      = (5,590,210,590,210,570,5,570,5,570);
      tangga5 : array [1..10] of word
      = (5,570,100,570,100,550,5,550,5,570);
      tangga6 : array [1..10] of word
      = (5,550,50,550,50,530,5,530,5,550);
      tangga01 : array [1..10] of word
      = (705,650,1010,650,1010,630,705,630,705,650);
      tangga02 : array [1..10] of word
      = (740,630,1010,630,1010,610,740,610,740,630);
      tangga03 : array [1..10] of word
      = (775,610,1010,610,1010,590,775,590,775,610);
      tangga04 : array [1..10] of word
      = (810,590,1010,590,1010,570,810,570,810,590);
      tangga05 : array [1..10] of word
      = (910,570,1010,570,1010,550,910,550,910,570);
      tangga06 : array [1..10] of word
      = (950,550,1010,550,1010,530,950,530,950,550);
      daun1 : array [1..8] of word
      = (80,250,100,300,60,300,80,250);
      daun2 : array [1..10] of word
      = (70,300,90,300,105,330,55,330,70,300);
      daun3 : array [1..10] of word
      = (68,330,93,330,108,360,50,360,68,330);
      batang1 : array [1..10] of word
      = (78,360,83,360,85,400,73,400,78,360);
      batang2 : array [1..10] of word
      = (505,550,515,550,520,650,500,650,505,550);
      jalan : array [1..10] of word
      = (600,400,601,400,500,650,300,650,600,400);
      ataprumah1 : array [1..8] of word
      = (300,430,350,460,250,460,300,430);
      ataprumah2 : array [1..10] of word
      = (300,430,370,410,420,435,350,460,300,430);
      dinding1 : array [1..10] of word
      = (260,460,345,460,340,500,260,500,260,460);
      dinding2 : array [1..12] of word
      = (340,460,350,460,410,440,410,465,340,500,340,460);
      sayapatas : array [1..10] of word
      = (100,97,100,80,102,80,106,97,100,97);
      sayapbawah : array [1..10] of word
      = (100,104,100,120,102,120,106,104,100,104);
      sayapekoratas : array [1..10] of word
      = (80,99,80,90,84,90,86,99,80,99);

var   driver, mode,I: integer;
      ukuran:word;
      citra:pointer;
begin
clrscr;
      driver:=detect;
      initgraph(driver,mode,'');
      setcolor(brown);
      setfillstyle (1,brown);
      fillpoly(5,garispinggir1);

      setcolor(green);
      setfillstyle (1,green);
      fillpoly(6,gunung1);

      setcolor(green);
      setfillstyle (1,green);
      fillpoly(4,gunung2);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,tangga1);

      setcolor(Magenta);
      setfillstyle (1,Magenta);
      fillpoly(5,tangga2);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,tangga3);

      setcolor(Magenta);
      setfillstyle (1,Magenta);
      fillpoly(5,tangga4);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,tangga5);

      setcolor(Magenta);
      setfillstyle (1,Magenta);
      fillpoly(5,tangga6);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,tangga01);

      setcolor(Magenta);
      setfillstyle (1,Magenta);
      fillpoly(5,tangga02);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,tangga03);

      setcolor(Magenta);
      setfillstyle (1,Magenta);
      fillpoly(5,tangga04);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,tangga05);

      setcolor(Magenta);
      setfillstyle (1,Magenta);
      fillpoly(5,tangga06);



      setcolor(LightCyan);
      setfillstyle (1,LightCyan);
      fillpoly(5,langit1);

      setcolor(LightCyan);
      setfillstyle (1,LightCyan);
      fillpoly(5,langit2);

      setcolor(LightCyan);
      setfillstyle (1,LightCyan);
      fillpoly(5,langit3);

      setcolor(LightCyan);
      setfillstyle (1,LightCyan);
      fillpoly(5,langit4);

      setcolor(LightGreen);
      setfillstyle (1,LightGreen);
      fillpoly(5,daun1);

      setcolor(Lightgreen);
      setfillstyle (1,Lightgreen);
      fillpoly(5,daun2);

      setcolor(lightgreen);
      setfillstyle (1,lightgreen);
      fillpoly(5,daun3);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,batang1);

      setcolor(White);
      setfillstyle (1,White);
      fillpoly(5,jalan);

      setcolor(DarkGray);
      setfillstyle (1,DarkGray);
      fillpoly(5,batang2);

      setcolor(Lightred);
      setfillstyle (1,Lightred);
      fillpoly(5,ataprumah1);

      setcolor(yellow);
      setfillstyle (1,yellow);
      fillpoly(5,ataprumah2);

      setcolor(lightblue);
      setfillstyle (1,lightblue);
      fillpoly(5,dinding1);

      setcolor(lightblue);
      setfillstyle (1,lightblue);
      fillpoly(5,dinding2);

      setcolor(blue);
      setfillstyle (1,blue);
      ellipse(100,100,0,360,120,3);
      floodfill (100,100,blue);

      setcolor(red);
      setfillstyle (1,red);
      fillpoly(5,sayapatas);

      setcolor(red);
      setfillstyle (1,red);
      fillpoly(5,sayapbawah);

      setcolor(red);
      setfillstyle (1,red);
      fillpoly(5,sayapekoratas);

      setcolor(Lightgreen);
      setfillstyle (1,Lightgreen);
      ellipse(510,540,0,360,30,30);
      floodfill (510,540,Lightgreen);

      setcolor(Lightgreen);
      setfillstyle (1,Lightgreen);
      ellipse(510,500,0,360,25,25);
      floodfill (510,500,Lightgreen);

      setcolor(Lightgreen);
      setfillstyle (1,Lightgreen);
      ellipse(510,470,0,360,15,15);
      floodfill (510,470,Lightgreen);

      setcolor(Lightgreen);
      setfillstyle (1,Lightgreen);
      ellipse(510,450,0,360,7,7);
      floodfill (510,450,Lightgreen);

      setcolor(white);
      setfillstyle (1,white);
      ellipse(300,190,0,360,50,20);
      floodfill (300,190,white);

      setcolor(white);
      setfillstyle (1,white);
      ellipse(550,240,0,360,80,10);
      floodfill (550,240,white);

      setcolor(white);
      setfillstyle (1,white);
      ellipse(350,180,0,360,80,20);
      floodfill (350,180,white);

      setcolor(white);
      setfillstyle (1,white);
      ellipse(600,200,0,360,100,30);
      floodfill (600,200,white);

      setcolor(white);
      setfillstyle (1,white);
      ellipse(900,50,0,360,50,20);
      floodfill (900,50,white);

      setcolor(white);
      setfillstyle (1,white);
      ellipse(800,50,0,360,90,40);
      floodfill (800,50,white);

      ukuran:=imagesize(80,80,120,120);
      getmem(citra,ukuran);
      getimage(80,80,120,120,citra^);
      {*menggerakan citra*}
      I:=80;
            repeat
                  putimage(I,80,citra^,xorput);
                  inc(I);
            putimage(I,80,citra^,copyput);
            until keypressed;
                  freemem(citra,ukuran);
readln;
end.

Tidak ada komentar:

Posting Komentar