I think that turtles should be able to detect objects on either side to aid in navigation.
Great work so far, I'm excited to see what's ahead!
--Anoliss
Turtles, turtle.detectLeft() turtle.detectRight()
Started by anoliss, Apr 05 2012 05:19 AM
10 replies to this topic
#1
Posted 05 April 2012 - 05:19 AM
#2
Posted 05 April 2012 - 05:29 AM
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
#3
Posted 05 April 2012 - 06:19 AM
Well, I would say that too, except that it is painfully slow when it comes to pathfinding and stuff like that.
#4
Posted 05 April 2012 - 01:48 PM
ComputerCraftFan11, on 05 April 2012 - 05:29 AM, said:
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
You, could. However, I agree with Liraal, it would be more efficient to have detectors for the sides.
#5
Posted 12 April 2012 - 07:33 PM
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?
/>
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?
#6
Posted 16 April 2012 - 06:52 PM
Dirkus7, on 12 April 2012 - 07:33 PM, said:
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?
/>
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?
#7
Posted 16 April 2012 - 08:33 PM
ComputerCraftFan11, on 05 April 2012 - 05:29 AM, said:
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
Just to point out, that function wouldn't work as it will return from the function before it turns back. A better solution would be this:
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
#8
Posted 20 May 2013 - 02:34 PM
Dirkus7, on 12 April 2012 - 07:33 PM, said:
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?
/>
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?
#9
Posted 20 May 2013 - 04:21 PM
But we can't see our a*s.
Do something like:
Do something like:
function detect(side) rs.setOutput(side, true) local r = rs.getInput(side) rs.setOutput(side, false) return r end
#10
Posted 20 May 2013 - 05:59 PM
jesusthekiller, on 20 May 2013 - 04:21 PM, said:
But we can't see our a*s.
Do something like:
Do something like:
function detect(side) rs.setOutput(side, true) local r = rs.getInput(side) rs.setOutput(side, false) return r end
#11
Posted 21 May 2013 - 01:50 PM
This was already denied. It won't be added. Don't bring up something from over a year ago.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


This topic is locked









