demos uploaded
This commit is contained in:
9
demos/cube.lua
Normal file
9
demos/cube.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
a=0 function l(b,c,i,j)d,e=i-b,j-c
|
||||
s=max(abs(d),abs(e))i,j=d/s,e/s for
|
||||
v=0,s-1 do b,c=b+i,c+j print("#",b,c)end end
|
||||
function r(u)f,g,h=(u>>2&1)*2-1,(u>>1&1)*2-1,(u&1)*2-1
|
||||
f,h=f*cos(a)-h*sin(a),f*sin(a)+h*cos(a)return f/(h+4),g/(h+4)end
|
||||
function update()cls()for n=0,7 do
|
||||
x,y=r(n)for k=0,2 do m=n~(1<<k)if m>n then
|
||||
f,g=r(m)l(20+x*40,15+y*30,20+f*40,15+g*30)
|
||||
end end end a=a+0.05 end
|
||||
Reference in New Issue
Block a user