如何在NetLogo中循环pxcor

如何在NetLogo中循环pxcor,netlogo,Netlogo,我是个新手。如何将pxcor的值从99循环到1 ask patches [ if chemicalR <= chemicalW and abs pycor < 1 and pxcor = 99 [sprout-red-cells 1] ] ask red-cells [ set color red set size 1 set shape "circle" ] ask补丁 [如果chemicalR在NetLogo中有一个循环命令。但是看看你的代码,我

我是个新手。如何将pxcor的值从99循环到1

ask patches
[ if chemicalR <= chemicalW and abs pycor < 1 and pxcor = 99
  [sprout-red-cells 1]
]
ask red-cells
[ set color red
  set size 1
  set shape "circle"
]
ask补丁

[如果chemicalR在NetLogo中有一个
循环
命令。但是看看你的代码,我怀疑你实际上想让每一个满足特定条件的补丁都长出一个红色的球。如果是这样的话,那么用补丁集来实现这一点就更直接了(也更直接)

ask patches with [chemicalR <= chemicalW and abs pycor < 1 and pxcor >= 1 and pxcor <= 99]
[ sprout-red-cells 1
  [ set color red
    set size 1
    set shape "circle"
  ]
]
ask带有[chemicalR=1和pxcor的补丁