please help me

i run this code to Quickbasic the problem is when i press down arrow at row 23 the 0 jumps to row 25.

is the problem is in locate function


this are the code i use

thanks


'when it comes to row 23 the 0( or cursor 0) jumps to row 25

CLS
null$ = CHR$(0)

y% = 1
x% = 1

LOCATE y%, x%

PRINT "0"

DO WHILE 1 '1

s$ = ""

DO WHILE s$ = "" '2

s$ = INKEY$

LOOP '2


SELECT CASE s$ '3

CASE null$ + CHR$(75) 'left

CLS

IF 1 < x% THEN '4
x% = x% - 1

END IF '4

LOCATE y%, x%
PRINT "0"

CASE null$ + CHR$(77) 'left

CLS

IF x% < 80 THEN '5

x% = x% + 1

END IF '5

LOCATE y%, x%

PRINT "0"

CASE null$ + CHR$(72) 'up

CLS

IF 1 < y% THEN '6

y% = y% - 1

END IF'6

LOCATE y%, x%
PRINT "0"

CASE null$ + CHR$(80) 'down

CLS

IF y% < 25 THEN '7
y% = y% + 1

END IF'7

LOCATE y%, x%
PRINT "0"

CASE "q"

END

END SELECT '3

LOOP '1