dim plane(3,3)
plane(2,3) = 5
`The 5 is currently in the 3rd row,
`so we must set n to 3.
n=3
set text opaque
do
text 300,300,str$(plane(1,1)) + " " + str$( plane(2,1) ) + " " +str$( plane(3,1) ) + " "
text 300,320,str$(plane(1,2)) + " " + str$( plane(2,2) ) + " " +str$( plane(3,2) ) + " "
text 300,340,str$(plane(1,3)) + " " + str$( plane(2,3) ) + " " +str$( plane(3,3) ) + " "
if upkey()=1
repeat
until upkey()=0
`move number 5 upwards
plane(2,n)=0
`decrease n
dec n
`make sure n stays between 1 and 3
if n<1 then n=3
plane(2,n)=5
endif
loop
-- or --
dim plane(3,3)
plane(2,3) = 5
set text opaque
do
text 300,300,str$(plane(1,1)) + " " + str$( plane(2,1) ) + " " +str$( plane(3,1) ) + " "
text 300,320,str$(plane(1,2)) + " " + str$( plane(2,2) ) + " " +str$( plane(3,2) ) + " "
text 300,340,str$(plane(1,3)) + " " + str$( plane(2,3) ) + " " +str$( plane(3,3) ) + " "
if upkey()=1
repeat
until upkey()=0
`move number 5 upwards
`(move the middle column up one place)
temp=plane(2,1)
plane(2,1)=plane(2,2)
plane(2,2)=plane(2,3)
plane(2,3)=temp
endif
loop
The first method remembers where the 5 is, and moves it up one, the second method moves the whole middle column up one place.
You could make your code more responsive by putting your 'repeat; until upkey()=0' just before the 'endif', and I recommend you put a 'cls' before the 'set text opaque' to combat the flickering-empty screen problem (which only occurs on some machines, but mine is one of them).
Don't forget 'sync', either.
16-colour PNGs pwn.
