Also if you are not indenting your code try indenting it. Then these sorts of errors become easier to spot.
if i < 19
for i = i to 19
for a = 0 to 9
if board(i,a,0) = 2
board(i-1,a,0) = board(i,a,0) : board(i-1,a,1) = board(i,a,1)
board(i,a,0) = 0 : board(i,a,1) = 0
endif
next a
next i
endif
becomes
if i < 19
for i = i to 19
for a = 0 to 9
if board(i,a,0) = 2
board(i-1,a,0) = board(i,a,0) : board(i-1,a,1) = board(i,a,1)
board(i,a,0) = 0 : board(i,a,1) = 0
endif
next a
next i
endif
Ignore me if your code is indented.
it's cool to hate