Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local direction = ">"
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function change(param1)
- direction = param1
- end
- function redraw()
- clear()
- write("\n+---+---+---+---+ +-Info-+\n")
- write("| | |Dir." ..direction.. " |\n")
- write("| | | |\n")
- write("| | +-Info-+\n")
- write("| |\n")
- write("+---+---+---+---+\n")
- write("| < | v | ^ | > |\n")
- write("+---+---+---+---+\n")
- if direction == ">" then
- term.setCursorPos(15, 9)
- elseif direction == "<" then
- term.setCursorPos(3, 9)
- elseif direction == "v" then
- term.setCursorPos(7, 9)
- elseif direction == "^" then
- term.setCursorPos(11, 9)
- end
- write("^")
- end
- while true do
- redraw()
- if rs.getInput("right") == true then
- clear()
- change(">")
- redraw()
- elseif rs.getInput("left") == true then
- clear()
- change("<")
- redraw()
- elseif rs.getInput("back") == true then
- clear()
- change("v")
- redraw()
- elseif rs.getInput("bottom") == true then
- clear()
- change("^")
- redraw()
- end
- redraw()
- sleep(0)
- redraw()
- end
Advertisement
Add Comment
Please, Sign In to add comment