{ (c) 1998 CREEQ <creeq@web.de> }
program Hunting;
uses Crt,Graph,Mouse;
var
  grDriver: Integer;
  grMode: Integer;
  a,b,x,y,z : word;
  k,l,i : integer;
  p : integer;
  punkte,ent : string;
  r,neu,e : byte;
label 1;
begin
  grDriver := Detect;
  InitGraph(grDriver, grMode,'');
  randomize;
  p :=  0;
  e :=  0;
  r := random(2);
  l := random(450);
  neu := 0;
  if r = 0 then k := -11;
  if r = 1 then k := 650;
  repeat
1:  if neu = 1 then begin r := random(2); neu := 2; end;
    if neu = 2 then if r = 0 then begin k := -11; l := random(480); neu := 0; end;
    if neu = 2 then if r = 1 then begin k := 650; l := random(480); neu := 0; end;
    str(p,punkte);
    str(e,ent);
    setcolor(white);
    outtextxy(0,0,'Punkte: ');
    outtextxy(60,0,punkte);
    outtextxy(0,10,'Entwischt: ');
    outtextxy(83,10,ent);
    setcolor(white);
    line(310,479,320,450);
    line(330,479,320,450);
    a := x;
    b := y;
    M_getpos(z,x,y);
    setcolor(white);
    line(x,y+15,x+30,y+15);
    line(x+15,y,x+15,y+30);
    if a <> x then cleardevice;
    if b <> y then cleardevice;
    if Mouse.Key=LEFTBUTTON then begin
      setcolor(lightred);
      line(320,450,x+15,y+15);
      delay(10);
      setcolor(black);
      line(320,450,x+15,y+15);
      end;
      if r = 0 then begin
        inc(k);
        setcolor(yellow);
        circle(k,l,10);
        setcolor(black);
        circle(k-1,l,10);
        if k = 650 then begin inc(e); cleardevice; end;
        if k = 650 then begin neu := 1; goto 1; end;
      end;
      if r = 1 then begin
        dec(k);
        setcolor(yellow);
        circle(k,l,10);
        setcolor(black);
        circle(k+1,l,10);
        if k = -11 then begin inc(e); cleardevice; end;
        if k = -11 then begin neu := 1; goto 1; end;
      end;
      if r = 0 then for i := -15 to +15 do
        if x+15+i = k then for i := -15 to +15 do if y+15+i = l then if mouse.key=LEFTBUTTON then begin 
        inc(p,10);
        cleardevice;
        neu := 1;
        goto 1;
      end;
      if r = 1 then for i := -15 to +15 do
        if x+15+i = k then for i := -15 to +15 do if y+15+i = l then if mouse.key=LEFTBUTTON then begin 
        inc(p,10);
        cleardevice;
        neu := 1;
        goto 1;
      end;
  until keypressed;
  readkey;
  closegraph;
end.

