Sorry, just add another -1 to the end of each data line.
DIM SHARED piece_square(40) AS INTEGER
DATA -1,35,34,33,32,31,38,37,36,27,22,26,23,28,21,24,25,-1,-1,-1
DATA -1,85,84,83,82,81,88,87,86,97,92,96,93,98,91,94,95,-1,-1,-1
FOR i = 0 TO 39: READ piece_square(i): NEXT