XileHorizon

holosphere

Aug 30th, 2018
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local component=require("component")
  2. local holo=component.hologram
  3. holo.setScale(2)
  4. holo.clear()
  5. local function dist(ax,ay,az,bx,by,bz)
  6.     return math.abs(math.sqrt((bx-ax)^2+(by-ay)^2+(bz-az)^2))
  7. end
  8. local function combine(bits)
  9.     local o=0
  10.     for k,v in pairs(bits) do
  11.         o=o+((2^(k-1))*(v and 1 or 0))
  12.     end
  13.     return o
  14. end
  15. for cx=1,32 do
  16.     for cz=1,32 do
  17.         local bits={}
  18.         for cy=1,32 do
  19.             bits[cy]=dist(cx,cy,cz,16,16,16)<16
  20.         end
  21.         os.sleep(0)
  22.         holo.set(cx+11,cz+11,combine(bits))
  23.     end
  24. end
Add Comment
Please, Sign In to add comment