在移动中改变乌龟的颜色

Change the color of the turtle on the move

我正在编写一个关于环岛交通的程序。我有 3 种颜色的 3 个不同方向的车是红色车右转,直行绿色车,天空左转。因为只有一条右转车道,我是不是应该把红车蓝天或其他AU换成不右转的车? 我应该使用什么功能来改变汽车的颜色?

这不正确,因为我无法从问题中准确计算出您需要什么,但您需要使用 with 语句来识别正确的汽车。这是接近我认为你想要的东西:

to ...
  ...
  let to-be-red cars with [ (heading = 0 or heading = 180)
                            and distancexy 0 0 < 30
                            and ycor < -11 ]
  ask to-be-red [ set color red ]
end