I'm new to Netlogo and have been chucked in at the deep end. Each turtle has a variable - colony, which is a number between 1-9. I'm wanting to get a turtle face towards its closest neighbour which has the same colony number as it does. It then moves (that bit works fine). At the moment I have
let newTurtle min-one-of other turtles [10]
let variableA [ask newTurtle [colony]]
ifelse colony = variableA newTurtle [face newTurtle] [rt random 360]
move-forward
This works and gets all turtles to move into 1 central location:
let newTurtle min-one-of other turtles [10]
face newTurtle
move-forward
What I've tried is to get a turtle to ask its neighbour for its colony, if there the same move towards, else move in random direction. "Expected a literal value" is currently the error regarding to the second line. I know this isn't exactly what I want but I can't get this working. Any help on this or my main problem would be appreciated!! Thanks