【问题标题】:in my code the turtles won't move when the patience is smaller than friction在我的代码中,当耐心小于摩擦时,海龟不会移动
【发布时间】:2019-02-08 21:08:32
【问题描述】:
to go
  ask turtles [
  if patience > friction [ speed-up
    set color red
     fd 1
    set walk-score walk-score + 3
    ]
    if patience < friction [ speed-down]
    ]
  tick
end
to speed-up
  set speed speed + acceleration
  if speed > speed-max [ set speed speed-max]
  fd speed
end
to speed-down
  set speed speed  - deceleration
  if speed < speed-min [set speed speed-min]
end

【问题讨论】:

    标签: performance acceleration


    【解决方案1】:

    现在您没有提供太多上下文,但您不需要调用 fd速度 在减速到移动乌龟?只是基于直觉,看起来像是实际移动小爬行动物的代码。

    【讨论】:

      猜你喜欢
      • 2018-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-15
      • 1970-01-01
      相关资源
      最近更新 更多