Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 10 REM LOOP
- 20 GR:HOME:COLOR=6
- 30 STARTX=0:STARTY=0:EX=39:EY=39:SIDE=1
- 40 PX=STARTX:PY=STARTY
- 50 PLOT PX, PY
- 60 IF SIDE=1 THEN GOSUB 200
- 70 IF SIDE=2 THEN GOSUB 300
- 80 IF SIDE=3 THEN GOSUB 400
- 90 IF SIDE=4 THEN GOSUB 500
- 100 IF STARTY = EY THEN END
- 110 GOTO 50
- 200 REM TOP -----
- 210 IF PX = EX THEN SIDE = 2
- 220 IF PX = EX THEN EX = EX - 1
- 230 IF PX < EX THEN PX=PX+1
- 240 RETURN
- 300 REM RIGHT ---
- 310 IF PY = EY THEN SIDE = 3
- 320 IF PY = EY THEN EY = EY - 1
- 330 IF PY < EY THEN PY = PY + 1
- 340 RETURN
- 400 REM BOTTOM --
- 410 IF PX = STARTX THEN SIDE = 4
- 420 IF PX = STARTX THEN STARTX = STARTX + 1
- 430 IF PX > STARTX THEN PX = PX - 1
- 440 RETURN
- 500 REM LEFT ----
- 510 IF PY = STARTY THEN SIDE = 1
- 520 IF PY = STARTY THEN STARTY = STARTY + 1
- 530 IF PY > STARTY THEN PY = PY - 1
- 540 RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement