Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by ololo ( 15 years ago )
Uses Crt, Graph;


Var GraphDriver, GraphMode : Integer;
    X,Y,i,r,radius,n : Integer;
    k:char;

Begin
 GraphDriver:=Detect;
 InitGraph(GraphDriver, GraphMode, '');
 If GraphResult<> grOk Then Halt;
 x:=10;
 i:=1;
 r:=0;
 y:=15;
 radius:=10;
 setbkcolor(white);
 randomize;
 while true do

  begin
  if x>630 then
  begin
  for n:=1 to 20 do
  begin
    setcolor(red);
    circle(x,y,n);
    delay(5000);
  end;
   x:=10;
   y:=15;
   i:=1;
   r:=0;
  end;
   if x<10 then
   begin
   for n:=1 to 20 do
   begin
     setcolor(red);
     circle(x,y,n);
     delay(5000);
   end;
    x:=10;
    y:=15;
    i:=1;
    r:=0;
   end;
    if y<10 then
    begin
    for n:=1 to 20 do
    begin
      setcolor(red);
      circle(x,y,n);
      delay(5000);
    end;
      x:=10;
      i:=1;
     y:=15;
     r:=0;
    end;
     if (x>=1) and (x<=151) and (y>=180) and (y<=480) and (2*x+y>=482) then {proverka, popadaet li centr kryga
      na levyu storony levoi gori}
     begin
     for n:=1 to 20 do
     begin
       setcolor(red);
       circle(x,y,n);
       delay(5000);
     end;
      x:=10;
      y:=15;
      i:=1;
      r:=0;
     end;
      if (x>=151) and (x<=301) and (y>=180) and (y<=480) and (2*x-y<=122) then {proverka, popadaet li centr kryga
       na pravyu storony levoi gori}
      begin
      for n:=1 to 20 do
      begin
        setcolor(red);
        circle(x,y,n);
        delay(5000);
      end;
       x:=15;
       y:=15;
       i:=1;
       r:=0;
      end;
       if (x>=340) and (x<=490) and (y>=180) and (y<=480) and (2*x+y>=1160) then {proverka, popadaet li centr kryga
        na levyu storony pravoi gori}
       begin
       for n:=1 to 20 do
       begin
         setcolor(red);
         circle(x,y,n);
         delay(5000);
       end;
        x:=10;
        y:=15;
        i:=1;
        r:=0;
       end;
        if (x>=490) and (x<=640) and (y>=180) and (y<=480) and (2*x-y<=800) then {proverka, popadaet li centr kryga
         na pravyu storony pravoi gori}
        begin
        for n:=1 to 20 do
        begin
          setcolor(red);
          circle(x,y,n);
          delay(5000);
        end;
         x:=10;
         y:=15;
         i:=1;
         r:=0;
        end;
         if (x>=300) and (x<=340) and (y>=440) then {popal li kryg na ploshadky}
         begin
          r:=0;
          i:=0;
          x:=320;
          y:=430;
         end;
   setcolor(green);
   circle(x,y,radius);
   delay(5500);
   cleardevice;
   x:=x+i;
   y:=y+r;
   if keypressed then
   begin
   k:=readkey;
    case k of
    'd': i:=i+1;
    'a': i:=i-1;
    's': r:=r+1;
    'w': r:=r-1;
    'q': exit;
    'e': begin
         i:=0;
         r:=0;
         end;
    end;
   end;
   line(1,480,151,180);
   line(151,180,301,480);
   line(340,480,490,180);
   line(490,180,640,480);
   rectangle(300,440,340,480);
   end;
 CloseGraph;
End.

 

Revise this Paste

Your Name: Code Language: