Advertisement
DYankee

etu

Oct 2nd, 2022
848
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.22 KB | None | 0 0
  1. function get_term_size()
  2.     local w,h = term.getSize()
  3.     return w,h
  4. end
  5.  
  6. function print_centered(y, s)
  7.    local w,h = get_term_size()
  8.    term.setCursorPos(math.floor( (w - string.len(s))/2 ), y)
  9.    print(s)
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement