Advertisement
DYankee

apitest

Sep 17th, 2022 (edited)
792
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.ceil( (w - string.len(s))/2 ), y)
  9.    print(s)
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement