|
5仿真币
下面的语句中ask patch和create-initial-turtles 后面接的[ ]中的语句是什么含义,其中非原语的都是定义的全局或者外部变量。语法有点奇怪,谁能帮我解释一下吗?多谢 . U' V, H$ S4 L2 K% K
to make-turtles5 d, t8 E) n+ v& T4 Q8 A
ask patch 0 0 [2 T2 ]) w3 A, d [8 v; U2 {" T
create-initial-turtles num-random-min "random-min" violet* l) F1 q% m$ J, y6 @
create-initial-turtles num-random "random" brown
P3 r& _% }+ c; J9 K8 z& J create-initial-turtles num-random-away "random-away" pink6 A$ ?5 G$ H$ O% W1 z4 u
create-initial-turtles num-open-min "open-min" blue
: n$ P% p4 d/ j7 W create-initial-turtles num-open-min-max "open-min-max" orange ]
" ^; P7 j' v( t set-common-variables, Z5 X9 \& s; \# }$ y1 ]3 I M& M( P
end/ E& z9 v( ^) _
5 c& U) W) x- C# Y
to create-initial-turtles [n turtle-rule turtle-color]
# {- z. Y: \( i' w2 L! L, _ ask n-of n (patches in-radius initial-radius with [not any? turtles-here])) g. w w3 P% |2 S
[ sprout 14 e' z1 {1 k5 S0 J; w+ z1 U8 X3 m
[ set rule turtle-rule* ]6 P: P# l5 K( E/ n6 ]
set color turtle-color ] ]
0 C! G& X N* u) j; uend
; k6 z( n- E7 x5 S% M$ i7 ~$ l% z! d. @
[ 本帖最后由 etamina 于 2008-4-30 13:05 编辑 ] |
|