|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。6 \, F. ?! y9 k0 ^* Q K
is ! u9 H5 S8 z. O3 J% d' {
a,b:integer;
8 {; [: t' D9 Y& fdo
! U; [ ~5 t7 x' c if store.cont.name="part1" then
( R8 B3 c5 i' }) u for a:=1 to 4 loop
; L6 J$ K$ q% {$ q, C% |5 P0 O store.cont.move;
6 g7 }; ~ f1 T next;
% T) x, ^, v* d) K. v$ x4 v. U: s elseif store.cont.name="part2" then
2 n9 s& I7 P2 E) z for b:=1to 3 loop2 Y9 S7 b& f6 |* q4 g; ^
store.cont.move;
1 k5 L$ H( |$ F/ [( B* z5 B# M next;
3 i/ k9 P9 ]8 |) {2 `" D elseif store.cont.name="part3" then
+ q' E2 ~! J% A& z2 t1 x store.cont.move;
b$ s. Y, Q" r& u) F, ~; }% y elseif store.cont.name="part4" then4 x3 J% G2 \* p8 `# j9 ]
store.cont.move;
* @" g- I# F0 U( a end;* m- \; p) ]3 B
end; |
|