Great work so far, I'm excited to see what's ahead!
–Anoliss
function detectLeft()
turtle.turnLeft()
return(turtle.detect())
turtle.turnRight()
end
function detectRight()
turtle.turnRight()
return(turtle.detect())
turtle.turnLeft()
end
Can't you just do this?function detectLeft() turtle.turnLeft() return(turtle.detect()) turtle.turnRight() end function detectRight() turtle.turnRight() return(turtle.detect()) turtle.turnLeft() end
Humans don't have eyes on the sides of their head, but they have hands (not on their head :)/>/>)True, but humans don't have eyes on the sides of their head.
But you're right, robots can have them, so why not turtles? They should have them.
And if left and right detecing is added, why not add turtle.detectBack() too? :)/>/>
Can't you just do this?function detectLeft() turtle.turnLeft() return(turtle.detect()) turtle.turnRight() end function detectRight() turtle.turnRight() return(turtle.detect()) turtle.turnLeft() end
function detectLeft()
turtle.turnLeft()
local ret = turtle.detect()
turtle.turnRight()
return ret
end
function detectRight()
turtle.turnRight()
local ret = turtle.detect()
turtle.turnLeft()
return ret
end
But we can move our eyes from side to side.True, but humans don't have eyes on the sides of their head.
But you're right, robots can have them, so why not turtles? They should have them.
And if left and right detecing is added, why not add turtle.detectBack() too? :P/>/>
function detect(side)
rs.setOutput(side, true)
local r = rs.getInput(side)
rs.setOutput(side, false)
return r
end
That only works with solid blocks, but not with trap doors etc.But we can't see our a*s.
Do something like:function detect(side) rs.setOutput(side, true) local r = rs.getInput(side) rs.setOutput(side, false) return r end