Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I7 need some help with indenting

0 views
Skip to first unread message

Al

unread,
Dec 21, 2009, 9:48:25 PM12/21/09
to
Can someone help with the indenting process on the last block of code.
It's driving me crazy trying to get it right.
I've split it up into 2 separate blocks but it should be able to be
expressed as a single block

All help appreciated. Thanks


<code>
Starter is a room.

a closed openable container called a box is in Starter.
the box is fixed in place.

a toy car, a ball, a bat, a tire iron, a transmission, a front end,
an engine block, a set of 4 chrome-spoked wheels, a set of 4 tires,
a back seat and a steering wheel are in the box.

[this format gives an error]

after opening the box:
if the number of things in the box is 0 begin;
say "The box is empty.";
otherwise;
say "Inside the box you find: [line break]":
repeat with item running through things in the box:
say "a [item][line break]";
end if.

<code>

Jim Aikin

unread,
Dec 21, 2009, 10:00:40 PM12/21/09
to
Looks to me like you're trying to combine the two formats. Also, you
have at least one colon where you need a semicolon. Try it this way:

after opening the box:
if the number of things in the box is 0:


say "The box is empty.";
otherwise:
say "Inside the box you find: [line break]";
repeat with item running through things in the box:

say "a [item][line break]".

Note that will print things like "a orange", since you have the article
outside of the text substitution. And I'm not too sure about the final
line break ... you may end up with too many blank lines.

--JA

0 new messages