Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local geo = component.geolyzer
- local gpu = component.gpu
- local denseChars = {" ", "-", "░", "▓", "█"}
- local toChar = function(d)
- return denseChars[math.max(1, math.min(5, 1+math.floor(d*2.0)))] or "?"
- end
- local scan = function(times)
- local result = geo.scan(0,0)
- for i=2,times do
- local blocks = geo.scan(0,0)
- for k,v in ipairs(blocks) do
- result[k] = result[k] + v
- end
- end
- for i=1,#result do
- result[i] = result[i] / times
- end
- return result
- end
- local printResult = function(result)
- for x=1,50 do
- gpu.set(x, 1, toChar(result[x]))
- end
- end
- printResult(scan(4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement