POV-Ray : Newsgroups : povray.general : inverse used in nested loop error : Re: inverse used in nested loop error Server Time
9 Aug 2024 11:27:41 EDT (-0400)
  Re: inverse used in nested loop error  
From: Warp
Date: 4 Sep 2000 05:42:19
Message: <39b36e7b@news.povray.org>
Bob Hughes <per### [at] aolcom?subject=pov-news:> wrote:
: Nice scripting Warp, except I never understood the { on the next line type
: of thing.

  There are tens (or hundreds?) different ways of indenting. That's the style
which I use. I have found it quite handy and clear.
  The idea inside this indentation is the following (ascii art follows, so
I hope you have a fixed-width font):

command
,---------------,
| Block         |
|_______________|

  Each command which requires its own block has the block in question
indented at the same level.
  The shape of the block itselt is the following:

{
    commands
}

  So the block begins with a { and ends with a }. Seeing matching parentheses
is easy because they are at the same level (I have NEVER understood the idea
in putting the opening parenthesis at the end of the command instead of
at the beginning of the block; seeing matching parentheses is extremely
difficult, if not impossible).
  The commands inside the block are indented (I use 4 spaces when programming,
2 when povraying, although I'm going to switch to 4 with povray as well, but
I have yet to tell emacs about it).

  The commands inside the block can have their own blocks as well, and the
exact same rules apply.

command
,--------------------,
|   command          |
|   ,---------------,|
|   |   commands    ||
|   |_______________||
|____________________|

  So it will look like:

command
{
    command
    {
        commands
    }
}

  When the blocks get larger and there are nested blocks you really are
grateful of seeing the matching parentheses so easily.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.