Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- dn = colors.lime
- de = colors.purple
- ds = colors.orange
- dw = colors.lightBlue
- rs = redstone
- function moveNorth()
- rs.setBundledOutput("left", dn)
- sleep(0.1)
- rs.setBundledOutput("left", 0)
- sleep(1)
- movement()
- end
- function moveEast()
- rs.setBundledOutput("left", de)
- sleep(0.1)
- rs.setBundledOutput("left", 0)
- sleep(1)
- movement()
- end
- function moveSouth()
- rs.setBundledOutput("left", ds)
- sleep(0.1)
- rs.setBundledOutput("left", 0)
- sleep(1)
- movement()
- end
- function moveWest()
- rs.setBundledOutput("left", dw)
- sleep(0.1)
- rs.setBundledOutput("left", 0)
- sleep(1)
- movement()
- end
- function movement()
- while true do
- print("What direction do you want to move?")
- print("Use (n) for North")
- print("Use (e) for East")
- print("Use (s) for South")
- print("Use (w) for West")
- print("Use (q) to Exit")
- direction = io.read()
- if direction == "n" then
- moveNorth()
- if direction == "e" then
- moveEast()
- else
- if direction == "s" then
- moveSouth()
- else
- if direction == "w" then
- moveWest()
- else
- if direction == "q" then
- break
- else
- print("Wrong choice")
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement