how to word this

here is what I have,

Table of large bull shark’s Movement
destination
nshal
mshal
lshal
kshal
jshal
startshal
ashal
bshal
cshal
dshal
eshal
fshal
gshal
hshal
ishal
passroom
rshal
qshal
pshal
oshal

large bull shark can be active or passive. large bull shark is active.

Every turn when large bull shark is active:
repeat through the Table of large bull shark’s Movement:
let last space be the location of large bull shark;
move large bull shark to destination entry;
blank out the whole row;
rule succeeds.

It works, but what I want is instead of the shark making its way through these rooms once I want it to keep going around in a continuous loop. Was not quite sure of the verbiage to use.

thanks.

Every turn when large bull shark is active: repeat through the Table of large bull shark's Movement: let last space be the location of large bull shark; move large bull shark to destination entry; blank out the whole row; rule succeeds.
Okay, this is code that doesn’t make a whole lot of sense. ‘Blank out the whole row’ is bad here, because it erases the entry; you’ll never be able to get it back again, so even if you loop things you’ll end up without a loop. What it’s doing right now is trying to repeat through the whole table, getting the first entry, destroying it, and then stopping the repeat because the rule succeeds. Meanwhile, ‘last space’ isn’t doing anything at all.

One simple way to deal with the issue is by using a number variable:

[code]Shark-count is a number that varies. Shark-count is 0.

Every turn when large bull shark is active:
now shark-count is shark-count + 1;
if shark-count is greater than the number of rows in the Table of Large Bull Shark’s Movement, now shark-count is 1;
choose row shark-count in the Table of Large Bull Shark’s Movement;
move large bull shark to destination entry.
[/code]
Because your table only has one column, of course, you might consider using a list instead – in particular, the special kind of list called a ring is set up for precisely this kind of issue. See Example 81 if you want to learn how rings work.

Thank you for the quick reply, that did the trick.