Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local gpu = component.gpu
- local w, h = gpu.getResolution()
- local brailleindex = {{0x1,0x8},{0x2,0x10},{0x4,0x20},{0x40,0x80}}
- local idfk = 0
- local btn = {[false] = 0, [true] = 1}
- function generatePattern()
- local outputstr = ""
- for y=0, h-1 do
- for x=0, w-1 do
- local c = 0
- for sy=0, 3 do
- for sx=0, 1 do
- local i = brailleindex[sy+1][sx+1]
- local tx, ty = x * 2 + sx, y * 4 + sy
- local p = (math.floor((tx * 0.25 + ty) / 8 + idfk) + btn[x > w * 0.25 and x < w * 0.75 and y > h * 0.25 and y < h * 0.75]) % 2
- c = c + p * i
- end
- end
- outputstr = outputstr .. unicode.char(0x2800+c)
- end
- end
- return outputstr
- end
- while true do
- io.write(generatePattern())
- idfk = idfk + 0.125
- if event.pull(0.1, "interrupted") == "interrupted" then
- return
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement