Задать движение стрелки на экране- QBasic(Бейсик)

M0:
CLS
kursor = 2
LOCATE kursor, 4
PRINT "->"
M1:
a$ = INKEY$
SELECT CASE a$
CASE ""
GOTO M1
CASE CHR$(27)
STOP: GOTO M0
CASE CHR$(0) + CHR$(80)
kursor = kursor + 2
GOTO M5
CASE CHR$(0) + CHR$(72)
kursor = kursor - 2
GOTO M5
CASE ELSE
GOTO M1
END SELECT
M5:
FOR i% = 2 TO 6 STEP 2
LOCATE i%, 4: PRINT "  "
NEXT i%
IF kursor = 8 THEN kursor = 2
IF kursor = 0 THEN kursor = 6
LOCATE kursor, 4
PRINT "->"
GOTO M1

Leave a Comment