|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
5 ^" M# ^$ M* Z# c5 G" @! V* u5 C2 zis 6 c$ z. n1 U1 q1 O, U; A$ e2 J
a,b:integer;5 S' u/ c# N( Y0 B# A7 m* S
do0 I5 j9 }7 o; E9 m
if store.cont.name="part1" then4 Y5 }$ d% G2 ^
for a:=1 to 4 loop) V& o; G; t7 }- J! b a1 {2 ?4 n
store.cont.move;9 v/ x$ \2 ^) `! B8 O* Y
next;
) e, k- t1 N8 [7 D2 |1 r elseif store.cont.name="part2" then$ ]; o- {" [. }/ a) J! b
for b:=1to 3 loop
! a5 t2 a o; i store.cont.move;
0 j8 D0 V: F2 k N4 F0 E next;
+ F2 C/ s! k) ~0 W elseif store.cont.name="part3" then
1 q# s7 a- V# V) U& g store.cont.move;: K( h- l+ h2 h) O( i% F
elseif store.cont.name="part4" then
8 H$ s4 H- \! Y2 e* ~ store.cont.move;4 \: @# { A- K0 f! }, G
end;
: S5 q6 q- V& ?/ a: W0 _. N end; |
|