I need help in Netlogo: when a turtle interacts witch a patch where it is currently placed on and the patch-variable (which is a string) decides if the turtles variable (which is an integer) grows. For example:
turtles-own [weight]
patches-own [food]
to setup
clear-all
create-turtles 1 [
setxy random-xcor random-ycor
]
ask patches[
if pxcor >= 0 [set pcolor green
set food "Fries" ]
if pxcor < 0 [set pcolor blue
set food "Burger" ]
]
reset-ticks
end
to go
increase-weight
walk-around
tick
end
to walk-around
ask turtles [
right random 120 - 60
fd 0.1
]
end
to increase-weight
ask turtles [
if food != "fries" [
set weight (weight + 1)]
if food != "burger" and [
set weight (weight + 10)]
]
end
The problem is the turles weight goes up by 11 not with the value of 1 OR 10. I guess its something with patch-here !? But i cant get it running.
Thanks a lot