Commandcracker

donut.lua

Mar 12th, 2021 (edited)
915
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- https://github.com/Commandcracker/CC-spinning-donut
  2.  
  3.              local a,b,c,d,
  4.          e,f,g,h;e=math;f=e.floor
  5.      ;g=e.cos;h=e.sin;a=0;b=0;
  6.   c={}d={}term.clear()while 1 do
  7.   os.queueEvent('')os.pullEvent()local
  8.  i,j;j=0;for k=1,1760 do c[k]=0 end;
  9.  for l=1,1760 do d[l]=' 'end;while j<
  10.  6.28 do j=j+0.07;i=0;while i<6.28 do i
  11. =i+0.02;local m,      n,o,p,q,r,s,k,t,
  12. u,l,v,w,x,y;m=h(        i)k=g(i)n=g(j)p=
  13. h(j)o=h(a)q=g(            a)r=n+2;s=1/(m
  14. *r*o+p*q+5)t=g(          b)u=h(b)l=m*r*q
  15.  -p*o;v=f(40+30*        s*(k*r*t-l*u))w
  16.  =f(12+15*s*(k*r*u+l*t))x=f(v+80*w)y=f(
  17.  8*((p*o-m*n*q)*t-m*n*o-p*q-k*n*u))if
  18.   22>w and w>0 and 80>v and v>0 and s>
  19.    c[x+1]then c[x+1]=s;if y>0 then d
  20.     [x+1]=string.sub(".,-~:;=!*#$@"
  21.       ,y+1,y+1)else d[x+1]='.'end
  22.         end end end;shell.run(
  23.          "clear")for k=1,1760
  24.  
  25. do if k%80~=0 then io.write(d[k])else
  26. print()end end;a=a+0.04;b=b+0.02 end
RAW Paste Data Copied