100 REM Hilbert Curve
105 REM (c) Tsuyoshi Kadokura
106 REM LM80C version Antonino Porcino
110 SCREEN 2:COLOR 7,1,1:GPRINT " HILBERT CURVE ",8,0,15,8
120 ODER=5
130 TURN=-1
140 DY=25/ODER
150 DX=0:X=0:Y=0
160 X=20:Y=20
170 REM MOVE(X,Y)
180 GOSUB 200
190 GOTO 190
200 ODER=ODER-1
210 TURN=-TURN
220 TMP=DY:DY=-TURN*DX:DX=TURN*TMP
230 IF ODER>0 THEN GOSUB 200
240 DRAW X,Y,X+DX,Y+DY:X=X+DX:Y=Y+DY
250 TURN=-TURN
260 TMP=DY:DY=-TURN*DX:DX=TURN*TMP
270 IF ODER>0 THEN GOSUB 200
280 DRAW X,Y,X+DX,Y+DY:X=X+DX:Y=Y+DY
290 IF ODER>0 THEN GOSUB 200
300 TMP=DY:DY=-TURN*DX:DX=TURN*TMP
310 TURN=-TURN
320 DRAW X,Y,X+DX,Y+DY:X=X+DX:Y=Y+DY
330 IF ODER>0 THEN GOSUB 200
340 TMP=DY:DY=-TURN*DX:DX=TURN*TMP
350 TURN=-TURN
360 ODER=ODER+1
370 RETURN
