program gonki2; uses Graph,crt,dos; label 1,2,4,7,8,10,12,13,14,16; procedure pregr1 (x,y,color:integer); begin setcolor(color); rectangle(x-5,y-5,x+5,y+5); circle(x-5,y-5,5); circle(x+5,y+5,5); end; procedure pregr2 (x,y,color:integer); begin setcolor(color); rectangle(x-7,y-7,x+7,y+7); circle(x-7,y-7,7); circle(x+7,y+7,7); circle(x+7,y-7,7); circle(x-7,y+7,7); end; procedure pregr3 (x,y,color:integer); begin setcolor(color); circle(x,y,6); rectangle(x+3,y+3,x+15,y+15); rectangle(x+3,y-3,x-15,y-15); rectangle(x-3,y+3,x+15,y-15); rectangle(x-3,y-3,x-15,y+15); end; procedure pregr4 (x,y,color:integer); begin setcolor(color); circle(x,y,6); rectangle(x+3,y+3,x+15,y+15); rectangle(x+3,y-3,x-15,y-15); rectangle(x-3,y+3,x+15,y-15); rectangle(x-3,y-3,x-15,y+15); circle(x+15,y+15,6); circle(x-15,y-15,6); circle(x+15,y-15,6); circle(x-15,y+15,6); end; procedure pregr5 (x,y,color:integer); begin setcolor(color); rectangle(x-14,y+6,x-20,y-6); rectangle(x+14,y+6,x+20,y-6); rectangle(x-6,y+14,x+6,y-20); rectangle(x+6,y+20,x-6,y-14); line(x-20,y,x+20,y); line(x,y-20,x,y+20); circle(x,y,5); end; procedure machin (x,y,color:integer); begin setcolor(color); line(x,y,x+4,y-5); line(x+8,y,x+4,y-5); circle(x,y+2,2); circle(x+8,y+2,2); circle(x,y+13,2); circle(x+8,y+13,2); rectangle(x,y,x+8,y+15); end; procedure machin2 (x,y:integer); begin setcolor(0); line(x,y,x+4,y-5); line(x+8,y,x+4,y-5); circle(x,y+2,2); circle(x+8,y+2,2); circle(x,y+13,2); circle(x+8,y+13,2); rectangle(x,y,x+8,y+8+7); end; function LeadingZero(w : longint) : String; {ç áë} var s : String; begin Str(w:0,s); if Length(s) = 1 then s := '0' + s; LeadingZero := s; end; var grDriver,grMode,errCode:Integer; h,a,b,c1,c2,c3,i,g1,g2,g3,o,t1,t2,t3,yn,yn1:integer; bomba,xxx,snarad:shortint; v5,v6,v7,snar,v,f,y,l,r,d,p,c,g:integer; x1,y1,x2,y2,x3,y3:real; e,r1,r2,r3,IGRICEN,igricen2,b5,b6,b7:char; PixelColor,q,q1,m1,m,s1,s,hund1,hund,ochki: Word; begin grDriver:=Detect; InitGraph(grDriver,grMode,'d:/pas'); begin 4: BEGIN setcolor(15); {¬¥­î誠} outtextxy(60,240,'START'); outtextxy(160,240,'EXIT'); r1:=readkey; t1:=ord(r1); case t1 of 75: begin setcolor(15); outtextxy(160,240,'EXIT'); setcolor(11); outtextxy(60,240,'START'); r2:=readkey; t2:=ord(r2); if t2=13 then goto 12 else goto 4; end; 77: begin setcolor(15); outtextxy(60,240,'START'); setcolor(11); outtextxy(160,240,'EXIT'); r3:=readkey; t3:=ord(r3); if t3=13 then goto 16 else goto 4; end; else goto 4; end; END; 12: cleardevice; setcolor(13); {梥â } outtextxy(1,1,' Dark Colors º '); outtextxy(1,9,' (Foreground & º Light Colors '); outtextxy(1,18,' Background) º (Foreground) '); outtextxy(1,27,'ÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍ '); outtextxy(1,36,' Black ³ 0 º DarkGray ³ 8 '); outtextxy(1,45,' Blue ³ 1 º LightBlue ³ 9 '); outtextxy(1,54,' Green ³ 2 º LightGreen ³ 10 '); outtextxy(1,63,' Cyan ³ 3 º LightCyan ³ 11 '); outtextxy(1,72,' Red ³ 4 º LightRed ³ 12 '); outtextxy(1,81,' Magenta ³ 5 º LightMagenta ³ 13 '); outtextxy(1,90,' Brown ³ 6 º Yellow ³ 14 '); outtextxy(1,99,' LightGray ³ 7 º White ³ 15 '); setcolor(11); outtextxy(160,240,'What color of barrier do you want?'); readln(c1); cleardevice; setcolor(13); {梥â } outtextxy(1,1,' Dark Colors º '); outtextxy(1,9,' (Foreground & º Light Colors '); outtextxy(1,18,' Background) º (Foreground) '); outtextxy(1,27,'ÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍ '); outtextxy(1,36,' Black ³ 0 º DarkGray ³ 8 '); outtextxy(1,45,' Blue ³ 1 º LightBlue ³ 9 '); outtextxy(1,54,' Green ³ 2 º LightGreen ³ 10 '); outtextxy(1,63,' Cyan ³ 3 º LightCyan ³ 11 '); outtextxy(1,72,' Red ³ 4 º LightRed ³ 12 '); outtextxy(1,81,' Magenta ³ 5 º LightMagenta ³ 13 '); outtextxy(1,90,' Brown ³ 6 º Yellow ³ 14 '); outtextxy(1,99,' LightGray ³ 7 º White ³ 15 '); setcolor(11); outtextxy(160,240,'What color of machin do you want?'); readln(c2); if c2=c1 then begin cleardevice; outtextxy(160,240,'This color of machin isnt true'); readln; goto 12; end; 1: cleardevice; bomba:=-1; v:=0; setcolor(11); outtextxy(160,240,'What level do you want?(1 to 9)'); readln(c3); if c3>9 then begin cleardevice; outtextxy(160,240,'this level to big.Please try again.'); r3:=readkey; goto 1; end; if c3<0 then begin cleardevice; outtextxy(160,240,'this level to small.Please try again.'); r3:=readkey; goto 1; end; cleardevice; setcolor (11); outtextxy(100,100,'LOADING...'); {loading} for r :=1 to 180 do begin rectangle(50,120,r+50,120); delay(1000); end; cleardevice; d:=1; a:=0; h:=300; snar:=25; snarad:=3; setcolor(c1); randomize; repeat {ª àâ } begin b:=random(10); a:=a+30; line(b+200,a,b+200,a+30); line(b+400,a,b+400,a+30); end; until a>=500; begin d:=0; c:=0; repeat; {¯à¥£à ¤ë} begin case c3 of 0: g:=900; 1: g:=30; 2: g:=25; 3: g:=20; 4: g:=15; 5: g:=10; 6: g:=5; 7: g:=4; 8: g:=3; 9: g:=1; end; setcolor (c1); d:=d+g; c:=random(190); if c3=1 then pregr1(c+210,d,c1); if c3=2 then pregr2(c+210,d,c1); if c3=3 then pregr3(c+210,d,c1); if c3=4 then pregr4(c+210,d,c1); if c3=5 then pregr5(c+210,d,c1); { if c3=6 then pregr6(c+210,d,c1); if c3=7 then pregr7(c+210,d,c1); if c3=8 then pregr8(c+210,d,c1); if c3=9 then pregr9(c+210,d,c1);} end; until d>=350; end; { ******************} ochki:=3000; outtextxy(100,100,'READY!'); DELAY(40000); DELAY(40000); GetTime(q,m,s,hund); setcolor (0); outtextxy(100,100,'READY!'); setcolor (15); outtextxy(50,300,'press to stop'); for y:=450 downto 1 do begin setcolor (15); if ochki>0 then dec(ochki); outtextxy(50,300,'press to stop'); if keypressed then {ã¯à ¢«¥­¨¥} begin e:=readkey; f:=ord(e); case f of 97,75: begin h:=h-2; machin (h,y,c2) end; 72,119: begin y:=y-7; machin (h,y,c2); end; 80,115: begin y:=y+10; if y>450 then y:=450; machin (h,y,c2); end; 100,77: begin h:=h+2; machin (h,y,c2) end; 32: begin setcolor(c2); for g3:=1 to 70+v do begin setcolor(c2); y:=round(y-0.5); circle(h+3,y-g3,snarad); machin (h,y,c2); delay(300); setcolor(0); circle(h+3,y-g3,snarad); {machin2(h,y);} end; end; 9: begin if bomba>=0 then goto 10; bomba:=bomba+1; for xxx:=1 to snar do begin setcolor(0); circle(h+1,y-100,xxx); circle(h,y-100,xxx); end; end; 71: begin b5:=readkey; v5:=ord(b5); if v5 =98 then begin b6:=readkey; v6:=ord(b6); if v6=117 then begin b7:=readkey; v7:=ord(b7); if v7=109 then bomba:=bomba-1; if v7=121 then snarad:=snarad+2; if v7=104 then snar:=snar+5; end; if v6=111 then v:=v+10; if v6=96 then goto 13; end; end; end; end; 10: if y<1 then y:=1; if y>450 then y:=450; for p:=1 to 14 do {¯à®¢¥àª  ¢à¥§ ­¨ï} begin for l:=1 to 20 do begin PixelColor := GetPixel(h+p-3,y-5+l); if PixelColor=c1 then goto 7 end; end; if pixelcolor<>4 then goto 8; 7: begin setcolor(11); {ª®­¥æ} outtextxy(getmaxx div 2,getmaxy div 2,'GAME OVER'); for g1:=1 to 75 do begin sound(1120); setcolor(14); circle(h,y,g1); delay(1000); end; for g2:=75 downto 1 do begin setcolor(16); outtextxy(50,300,'press to stop'); sound(920); circle(h,y,g2); delay(1000); end; nosound; goto 2; end; 8: machin (h,y,c2); delay(2500); setcolor(0); machin2 (h,y); end; {******************} end; 13: setcolor (0); outtextxy(50,300,'press to stop'); setcolor (11); outtextxy(250,240,'YOU WIN THE MATH!!!'); outtextxy(1,90,leadingzero(ochki)); 2: setcolor(11); outtextxy(250,280,'do yo want to go to the next stage?(Y/N)'); IGRICEN:=READKEY; yn:=ord(igricen); case yn of 121: begin 14: setcolor(0); outtextxy(250,280,'do yo want to go to the next stage?(Y/N)'); setcolor(11); outtextxy(250,280,'do yo want to modifi the color?(Y/N)'); IGRICEN2:=READKEY; yn1:=ord(igricen2); case yn1 of 121: goto 12; 110: goto 1; else goto 14; end; end; 110: goto 16; else goto 2; end; 16: CloseGraph; end.