Correct Program spacing

For builders to discuss and ask building questions.
Post Reply
Thurgan
Sword Journeyman
Sword Journeyman
Posts: 138
Joined: Thu Dec 24, 2015 12:26 pm

Correct Program spacing

Post by Thurgan » Thu Apr 05, 2018 7:34 pm

Can someone help me with program spacing? I know I buggered it up in my area file and was asked to fix it. Is this remotely close, and if not could someone correctly space this for me so I can use it as a judge to do the others ones?
Thanks!

>give_prog 38308~

mpecho Thorim turns the token over in his hands and bobs his head slightly.

sayto $n Ye earned a token I see, proves yer perhaps capable to be learnin sumthin.

sayto $n The ways of the dwarves be many, whit were it ye be seekin tae learn?

mpmset $n quest 5 3 1

mpmset $n quest 5 3 2

mpjunk 38308

else

if quest(5, 3, $n) == 2

mpecho Thorim turns the token over in his hands and bobs his head slightly.

sayto $n Ye earned another token I see.

sayto $n The ways of the dwarves be many, whit were it ye be seekin tae learn?

mpjunk 38308

mpmset $n quest 5 3 3

else

if quest(5, 3, $n) == 3

mpecho Thorim turns the token over in his hands and bobs his head slightly.

sayto $n Ye earned another token I see.

sayto $n The ways of the dwarves be many, whit were it ye be seekin tae learn?

mpjunk 38308

mpmset $n quest 5 3 4

else

if quest(5, 3, $n) == 4

mpecho Thorim turns the token over in his hands and bobs his head slightly.

sayto $n Ye earned another token I see.

sayto $n The ways of the dwarves be many, whit were it ye be seekin tae learn?

mpjunk 38308

mpmset $n quest 5 3 5

endif

endif

endif

~

Thurgan
Sword Journeyman
Sword Journeyman
Posts: 138
Joined: Thu Dec 24, 2015 12:26 pm

Re: Correct Program spacing

Post by Thurgan » Thu Apr 05, 2018 7:36 pm

Of course that removed all of the spacing entirely when I posted it...lol

Areia
Sword Grand Master
Sword Grand Master
Posts: 482
Joined: Fri Feb 12, 2016 11:11 pm

Re: Correct Program spacing

Post by Areia » Thu Apr 05, 2018 8:26 pm

I did the same thing; I was way too used to Python's 4-space indent lol. We use 2-space indentation, so your main block starts at column 1 (no indentation at all), first indent is at column 3, second at 5, etc. I could send you an example by email if you like, since forums aren't very code friendly. Pm if interested!

Incidentally, I was also directed in a few other finer points not mentioned in the lessons that your above snippet includes. Setting qbits should be done at the start of a block, not at the end, and we use questr not quest to check and set qbits.

Hope that's remotely helpful. :)
Nascentes morimur, finisque ab origine pendet.

User avatar
Harroghty
Staff
Staff
Posts: 9489
Joined: Tue Jul 27, 2004 5:38 pm

Re: Correct Program spacing

Post by Harroghty » Thu Apr 05, 2018 10:13 pm

You can also reference this example area:

http://www.forgottenkingdoms.org/builde ... torial.php
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons

Thurgan
Sword Journeyman
Sword Journeyman
Posts: 138
Joined: Thu Dec 24, 2015 12:26 pm

Re: Correct Program spacing

Post by Thurgan » Thu Apr 05, 2018 10:53 pm

Thanks, PM sent Areia. The sample is also helpful, thanks! I had actually forgotten all about it

Is the spacing actually critical to operation, or does it just make it easier to see/understand when looking at it?

User avatar
Harroghty
Staff
Staff
Posts: 9489
Joined: Tue Jul 27, 2004 5:38 pm

Re: Correct Program spacing

Post by Harroghty » Thu Apr 05, 2018 11:44 pm

No, the spacing is an administrative requirement not a technical one.
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons

Post Reply