PROGRAM PITTURA(input,output,fileout); (* produced by Marcello Mengoni - www.mengoni.org *) uses crt,Graph; var grDriver : Integer; grMode : Integer; ErrCode : Integer; ch,x,y,xx,yy:integer; indice,scanx,scany,colore:integer; cursore,imagechunk,tavola,fre:pointer; col1,col2,sfondo:integer; interruttore,azionatore,ok:boolean; procedure rettangolo(tavx,tavy,colore1,colore2:integer); var tav1,tav2,tav3,tav4,tav5,tav6:integer; begin for tav1:=0 to 10 do begin for tav2:=0 to 15 do begin tav3:=tav2*2; tav4:=tav3+1; putpixel(tav3,tav1,colore1); putpixel(tav4,tav1,colore2) end end; getmem(imagechunk,imagesize(0,0,31,11)); getimage(0,0,31,11,imagechunk^); putimage(0,0,imagechunk^,1); putimage(tavx,tavy,imagechunk^,0); end; procedure tavolozza; begin rettangolo(30,446,4,12); rettangolo(30,458,4,4); rettangolo(30,470,4,8); rettangolo(64,446,12,7); rettangolo(64,458,12,12); rettangolo(64,470,12,8); rettangolo(98,446,6,15); rettangolo(98,458,6,6); rettangolo(98,470,6,8); rettangolo(132,446,14,15); rettangolo(132,458,14,14); rettangolo(132,470,10,14); rettangolo(166,446,11,14); rettangolo(166,458,10,10); rettangolo(166,470,10,2); rettangolo(200,446,2,11); rettangolo(200,458,2,2); rettangolo(200,470,2,0); rettangolo(234,446,3,15); rettangolo(234,458,3,3); rettangolo(234,470,3,9); rettangolo(268,446,9,15); rettangolo(268,458,9,9); rettangolo(268,470,9,1); rettangolo(302,446,1,7); rettangolo(302,458,1,1); rettangolo(302,470,1,0); rettangolo(336,446,5,4); rettangolo(336,458,5,5); rettangolo(336,470,5,1); rettangolo(370,446,13,11); rettangolo(370,458,13,13); rettangolo(370,470,13,5); rettangolo(438,446,15,11); rettangolo(438,458,15,15); rettangolo(438,470,15,7); rettangolo(404,446,11,15); rettangolo(404,458,11,11); rettangolo(404,470,11,3); rettangolo(472,446,7,11); rettangolo(472,458,7,7); rettangolo(472,470,7,8); rettangolo(506,446,8,3); rettangolo(506,458,8,8); rettangolo(506,470,8,0); rettangolo(540,446,0,15); rettangolo(540,458,0,0); rettangolo(540,470,0,6); getmem(tavola,imagesize(0,446,639,480)); getimage(0,446,639,480,tavola^); putimage(0,446,tavola^,1); end; procedure pennello(colore1,colore2:integer); var conta:integer; begin for conta:=1 to 10 do begin putpixel(1,conta,colore1); putpixel(2,conta,colore2); putpixel(3,conta,colore1); putpixel(4,conta,colore2); putpixel(5,conta,colore1); putpixel(6,conta,colore2); putpixel(7,conta,colore1); putpixel(8,conta,colore2); putpixel(9,conta,colore1); putpixel(10,conta,colore2); end; getmem(cursore,imagesize(1,1,10,10)); getimage(1,1,10,10,cursore^); putimage(1,1,cursore^,1); end; procedure freccia; var conta:integer; begin line(2,0,12,10); line(1,1,11,11); line(0,2,10,12); for conta:=6 to 16 do line(conta,16,16,conta); getmem(fre,imagesize(0,0,16,16)); getimage(0,0,16,16,fre^); putimage(0,0,fre^,1); end; procedure loop(co1,co2:integer); begin azionatore:=false; sound(500); delay(100); nosound; pennello(co1,co2); end; begin grDriver := Detect; InitGraph(grDriver,grMode,''); setvisualpage(1); setactivepage(0); tavolozza; col1:=1; col2:=9; setvisualpage(0); pennello(col1,col2); freccia; x:=150; y:=160; putimage(x,y,cursore^,0); xx:=320; yy:=446; repeat ch:=ord(readkey); case ch of 72 : y:=y-2; 75 : x:=x-2; 77 : x:=x+2; 80 : y:=y+2; 60 : begin putimage(0,446,tavola^,0); freccia; putimage(xx,yy,fre^,1); ok:=true; repeat; ch:=ord(readkey); case ch of 72 : yy:=yy-2; 75 : xx:=xx-2; 77 : xx:=xx+2; 80 : yy:=yy+2; 32 : begin if ((yy>429)and((xx>13)and(xx<563))) then begin interruttore:=true; putimage(xx,yy,fre^,1); ok:=false; ch:=60; if yy<442 then begin interruttore:=false; azionatore:=true; if xx<48 then loop(4,12); if (xx<82)and(azionatore) then loop(12,7); if (xx<116)and(azionatore) then loop(6,15); if (xx<150)and(azionatore) then loop(14,15); if (xx<184)and(azionatore) then loop(11,14); if (xx<218)and(azionatore) then loop(2,11); if (xx<252)and(azionatore) then loop(3,15); if (xx<286)and(azionatore) then loop(9,15); if (xx<320)and(azionatore) then loop(1,7); if (xx<354)and(azionatore) then loop(5,4); if (xx<388)and(azionatore) then loop(13,11); if (xx<422)and(azionatore) then loop(15,11); if (xx<456)and(azionatore) then loop(11,15); if (xx<490)and(azionatore) then loop(7,11); if (xx<524)and(azionatore) then loop(8,3); if (xx<558)and(azionatore) then loop(0,15); end; if (yy<454)and(interruttore) then begin interruttore:=false; azionatore:=true; if xx<48 then loop(4,4); if (xx<82)and(azionatore) then loop(12,12); if (xx<116)and(azionatore) then loop(6,6); if (xx<150)and(azionatore) then loop(14,14); if (xx<184)and(azionatore) then loop(10,10); if (xx<218)and(azionatore) then loop(2,2); if (xx<252)and(azionatore) then loop(3,3); if (xx<286)and(azionatore) then loop(9,9); if (xx<320)and(azionatore) then loop(1,1); if (xx<354)and(azionatore) then loop(5,5); if (xx<388)and(azionatore) then loop(13,13); if (xx<422)and(azionatore) then loop(15,15); if (xx<456)and(azionatore) then loop(11,11); if (xx<490)and(azionatore) then loop(7,7); if (xx<524)and(azionatore) then loop(8,8); if (xx<558)and(azionatore) then loop(0,0); end; if interruttore then begin interruttore:=false; azionatore:=true; if xx<48 then loop(4,8); if (xx<82)and(azionatore) then loop(12,8); if (xx<116)and(azionatore) then loop(6,8); if (xx<150)and(azionatore) then loop(10,14); if (xx<184)and(azionatore) then loop(10,2); if (xx<218)and(azionatore) then loop(2,0); if (xx<252)and(azionatore) then loop(3,9); if (xx<286)and(azionatore) then loop(9,1); if (xx<320)and(azionatore) then loop(1,0); if (xx<354)and(azionatore) then loop(5,1); if (xx<388)and(azionatore) then loop(13,15); if (xx<422)and(azionatore) then loop(15,7); if (xx<456)and(azionatore) then loop(11,3); if (xx<490)and(azionatore) then loop(7,8); if (xx<524)and(azionatore) then loop(8,0); if (xx<558)and(azionatore) then loop(0,6); end; end; end; end; if ok then putimage(xx,yy,fre^,1); until (ch=60) or (ch=27); putimage(0,446,tavola^,1); end; end; putimage(x,y,cursore^,0); until ch=27; CloseGraph; end.