Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centerText(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- end
- centerText("Hello World")
Add Comment
Please, Sign In to add comment