discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: ] Re: code needed

NH
nop head
Tue, Oct 25, 2022 1:59 PM

Sorry I hadn't noticed your reply was private.

Each simply adds each element to the outer list as an individual item.
Without it you would get a list of two element lists.

On Tue, 25 Oct 2022 at 14:53, Raymond West raywest@raywest.com wrote:

That does it nicely, thanks. Now I'll have to pick it through to
understand what is going on. You going to correct your reply to the list?

Best wishes,

Ray

On 25/10/2022 14:42, nop head wrote:

Try this:

a = 18;
b = 10;
n = 5;

list = [for(i = [0 : n], k = i * (a + b)) each [k, k + a]];

echo(list);

Sorry I hadn't noticed your reply was private. Each simply adds each element to the outer list as an individual item. Without it you would get a list of two element lists. On Tue, 25 Oct 2022 at 14:53, Raymond West <raywest@raywest.com> wrote: > That does it nicely, thanks. Now I'll have to pick it through to > understand what is going on. You going to correct your reply to the list? > > > Best wishes, > > Ray > > On 25/10/2022 14:42, nop head wrote: > > Try this: > > > > a = 18; > > b = 10; > > n = 5; > > > > list = [for(i = [0 : n], k = i * (a + b)) each [k, k + a]]; > > > > echo(list); >