Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawBox(xmin,xmax,ymin,ymax,color)
- numB = ymax - ymin
- numA = xmax - xmin
- term.setBackgroundColor(color)
- for i = 1,numB do
- term.setCursorPos(xmin,(ymin+i))
- print("|" .. string.rep(" ",numA-2) .. "|")
- end
- term.setCursorPos(xmin,ymin)
- print(string.rep("=",numA))
- term.setCursorPos(xmin,ymax)
- print(string.rep("=",numA))
- term.setCursorPos((numA/2) + xmin - (string.len(text)/2), ymin + (numB/2))
- term.setCursorPos(1,ymax+1)
- end
- drawSquare(1,20,1,3, "It works!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement