Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sText = "1"
- local sSide = "back"
- local function printCenter(mon, txt)
- local w, h = mon.getSize()
- local x = math.floor((w / 2) - (#txt / 2))
- local y = math.floor((h / 2))
- mon.setCursorPos(x, y)
- mon.write(txt)
- end
- local monitor = peripheral.wrap(sSide)
- printCenter(monitor, sText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement