02-10-2018, 02:03 PM

Code:

`SCREEN _NEWIMAGE(1366, 768, 8)`

LINE (0, 0)-(0, 0)

Hilbert 8, 3, 2

SUB Hilbert (depth AS INTEGER, dx AS SINGLE, dy AS SINGLE)

_DELAY .001

IF depth > 1 THEN Hilbert depth - 1, dy, dx

LINE -STEP(dx, dy), _RGB(255, 127, depth * 9)

IF depth > 1 THEN Hilbert depth - 1, dx, dy

LINE -STEP(dy, dx), _RGB(255, depth * depth, depth * 10)

IF depth > 1 THEN Hilbert depth - 1, dx, dy

LINE -STEP(-dx, -dy), _RGB(255, 127, depth * 11)

IF depth >= 0 THEN Hilbert depth - 1, -dy, -dx

END SUB