?? hilbert.lua
字號:
-- hilbert.c-- Hilbert curve-- Luiz Henrique de Figueiredo (lhf@csg.uwaterloo.ca)-- 10 Nov 95$debugdofile("ps.lua")function p() PS.lineto(x,y)endfunction a(n) if (n==0) then return else n=n-1 end d(n); y=y+h; p(); a(n); x=x+h; p(); a(n); y=y-h; p(); b(n);endfunction b(n) if (n==0) then return else n=n-1 end c(n); x=x-h; p(); b(n); y=y-h; p(); b(n); x=x+h; p(); a(n);endfunction c(n) if (n==0) then return else n=n-1 end b(n); y=y-h; p(); c(n); x=x-h; p(); c(n); y=y+h; p(); d(n);endfunction d(n) if (n==0) then return else n=n-1 end a(n); x=x+h; p(); d(n); y=y+h; p(); d(n); x=x-h; p(); c(n);endfunction hilbert(n) PS.open("hilbert curve") h=2^(9-n) x=0 y=0 PS.moveto(x,y) a(n) PS.close()endhilbert(5)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -