【发布时间】:2019-12-02 19:32:00
【问题描述】:
我是 NetLogo 的新手,我不确定如何将 300 名斯巴达人排成一排。假设一个 2x5 块的区域,海龟相互重叠。我尝试过使用新芽,这达到了特定的坐标要求,但是每个补丁只有一个海龟。这是我的一些代码。
ask patches with [pxcor > 0 and pycor > -2 and pycor < 2]
[ sprout 1 [ set color red ] ]
or
to setup-spartans
create-spartans 300
set-default-shape turtles "person"
ask spartans
[ setxy random-xcor -3 ;; makes only a single row and goes across entire screen
;; (I need it to be in a specific area)
set heading 180
set color red ]
end
【问题讨论】:
标签: netlogo