Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local geolyzer = component.geolyzer
- local gpu = component.gpu -- получаем прокси видеокарты
- local sides = require("sides")
- local w, h = gpu.getResolution()
- if not component.isAvailable("geolyzer") then
- print("This program requires a geolyzer")
- end
- function clear()
- gpu.setBackground(0x000000)
- gpu.fill(1, 1, w, h, " ") -- очищаем экран
- end
- function _return()
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- end
- local offsetx = 0 -- 4
- local offsetz = 0 -- -3
- local offsety = 0 -- -5
- local sizex = 8 --3
- local sizez = 8 --4
- local sizey = 1 --5
- local map = {}
- local color = 0--x00FF00
- local scanData = geolyzer.scan(offsetx, offsetz, offsety, sizex, sizez, sizey)
- clear()
- local i = 1
- for y = 0, sizey - 1 do
- for z = 0, sizez - 1 do
- for x = 0, sizex - 1 do
- -- alternatively when thinking in terms of 3-dimensional table: map[offsety + y][offsetz + z][offsetx + x] = scanData[i]
- map[i] = {posx = offsetx + x, posy = offsety + y, posz = offsetz + z, hardness = scanData[i]}
- i = i + 1
- end
- end
- end
- for i = 1, sizex*sizez*sizey do
- --print(map[i].posx, map[i].posy, map[i].posz, map[i].hardness)
- if tbl[x][y]>99 then
- color = 0x0000FF
- else
- color = 0x00FF00
- end
- gpu.setBackground(color)
- gpu.set(map[i].posx, map[i].posz," ")
- end
- _return()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement