|
楼主 |
发表于 2008-8-25 14:43:48
|
显示全部楼层
我知道了!
程序写成如下就可以解决了:' s# m- ]6 K9 |; [0 [9 s) a* a" \
! X" y6 M: P H+ ? @
globals [ a ]5 }) m6 Q$ }8 a& Z( O
breed [As a-A]
0 d3 m1 l5 c( X3 h9 g% S" }7 k6 sbreed [Bs a-B]
# I6 w, s8 ~$ c U" Gto setup
" G+ X1 g% m. l) k1 ^" U clear-all, ^- ^, w3 @6 e$ _0 R% l
create-As 10[setxy random(5) random(5)
& I" D2 V5 C" W0 `% p( Mset color 3]
0 |, I; y2 N( V3 h8 b" \8 @0 T5 O; }% }! Q) w
set a (20)- G, I$ U8 L! O- j6 {1 _+ f, z- H. e" q
create-Bs 10[
6 F2 D# d( Y- Q& [/ Z: oforeach [10 11 12 13 14 15 16 17 18 19 ] [3 R- |! y- S$ B2 \9 I7 u9 F
ask a-B ? [setxy a a - ^' _' ^% V- X4 `# N+ i4 J0 o
set a (a + 1)
~* v: O7 z$ f! Hset color 45
! ?6 v* l/ @5 y; [0 p] ]7 B/ l( R b/ f, N9 M
]
2 E7 g" ^( Z; W$ H" l" { $ P3 e0 E3 ?; l% \) Q
end Y1 i: p: |1 I
2 u( r4 V0 K2 _/ L& p! Y6 J$ |; `2 J+ V h
to go * ~3 o, Y- X4 k0 z# D
ask a-B 10 [set color 15]6 P9 {% `0 q( D. }
end |
|