anchor.diff:  
       { dispatch to all actors }
       i := 0;
  -    while i < numActors do
  +    numActors := actors.length;
  +    while i < actors.length do
         begin
           a := actors[ i ];
           if a^.active then begin
  
positive.code:           end
          end else inc(i) { was inactive, skip over for now }
        end;
    end;
  
  procedure Draw;
    var i : byte;
    begin
      if numActors > 0 then
        for i := 0 to numActors-1 do
          if actors[ i ]^.Visible then actors[ i ]^.Render
    end;
  
  function Done : Boolean;
    begin
      result := numActors = 0;
    end;
  
  procedure Run;
    begin
      repeat step; draw until done;
      halt;
    end;
  
  initialization
  
    kvm.ClrScr;
    numActors := 0; numTokens := 0;
    focus := New(Shell, Create);
    Register(focus);
  
  finalization
  
    cw.cwriteln( '|w|!k' );
    kvm.ClrScr;
    writeln('terminated cleanly.');
  
  end.
  
negative.code: 
  procedure Step;
    var i : byte; ch : char; a : Actor; msg:Event; numactors : cardinal;
    begin
      // TODO: without this next line (at least on freebsd)
      // it won't readkey. why not!?!
      if not keypressed then sleep(50);
  