POV-Ray : Newsgroups : povray.bugreports : alpha.10064268 macro problem : Re: alpha.10064268 macro problem Server Time
23 Apr 2024 20:15:07 EDT (-0400)
  Re: alpha.10064268 macro problem  
From: Tor Olav Kristensen
Date: 5 Apr 2021 22:20:00
Message: <web.606bc3c854e5aabad6f19eb189db30a9@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
>...
> while on the subject, and given you seem interested :-), I'm pondering how to
> reduce duplication of essentially identical/near identical code; am thinking
> that an "odometer" type macro to compute the set of indices would allow me to
> write much more "compact" walker macros.  any suggestions?  cheers.

Bill's recent suggestion to you made me think of ways to iterate over the
indices of an array.

As my favorite programming language is Python, I tried out my ideas there.

So if you are familiar with Python, have a look at attached PDF-file.
The code in the 2 last cells shouldn't be hard to convert to POV-Ray's SDL.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message


Attachments:
Download 'iterate over an array.pdf' (42 KB)

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