anchor.diff:    Posi   : array [1..2] of integer;
     end;
     Snake = record
  -  Length : integer;
  -  Shape  : char;
  -  Dead   : boolean;
  -  Dir    : char;
  +  Length   : integer;
  +  Shape    : char;
  +  Dead     : boolean;
  +  Dir      : char;
     HeadPos, BackPos : array [1..2] of integer;
     end;
  +  Board = array [2..25, 2..80] of  char;
   var
     score, game    : PWindow;
     max_y, max_x   : integer; { max screen size }
  
positive.code:     end;
      rk := wgetch(game);
      case rk of
        67 : Dir := 'R';
        68  : Dir := 'L';
        65    : Dir := 'U';
        66  : Dir := 'D';
      end;
      movingSnake(PSnake, Dir);
      checkCollision(PSnake, PApple);
      if (PApple.Eaten) or (scr = -1) then begin
        {mvwdelch(game, rand_y, rand_x);}
        mvwprintw(game, rand_y, rand_x, ' ');
        generateApple(max_y, max_x, rand_y, rand_x);
        Inc(scr);
        Inc(PSnake.Length);
      end;
      { Displaying the snake; I didn't use a dummy matrix just for the dispalying }
      for i:=0 to PSnake.Length do
        begin
          if (PSnake.Dir = 'U') or (PSnake.Dir = 'D') then
            mvwprintw(game, PSnake.HeadPos[1]-i, PSnake.HeadPos[2], 'O')
          else mvwprintw(game, PSnake.HeadPos[1], PSnake.HeadPos[2]-i, 'O');
          napms(20);
        end;
      { this cleans behind the Snake }
      { Displaying score }
      //mvwprintw(game, PSnake.HeadPos[1], PSnake.HeadPos[2]-, ' ');
      mvwprintw(score, 1, 1, PChar(concat(IntToStr(scr), '                   '))); { the argument must be passed as a PChar }
      wrefresh(game);
      wrefresh(score);
    end;
    endwin();
  END.
  
negative.code:     mvwprintw(win, i, 0, '|');
      mvwprintw(win, i, x - 1, '|');
    end;
    for i:= 1 to (x - 2) do begin
      mvwprintw(win, 0, i, '-');
      mvwprintw(win, y - 1, i, '-');
    end;
  