loop question bell

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
gratkowski
Posts: 41
Joined: Tue Aug 21, 2012 12:50 pm

loop question bell

Post by gratkowski » Sun Jun 25, 2023 2:20 pm

Hi,

how do I get a list i.e. [1 2 3 4] added by 0...x

Inlet 1 would be the number of iterations
Inlet 2 the list [1 2 3 4]

the result if inlet one = 3 should be
[[1 2 3 4] [2 3 4 5] [3 4 5 6]]

I would love to write this in Bell.

Thanks
FRANK

gratkowski
Posts: 41
Joined: Tue Aug 21, 2012 12:50 pm

Re: loop question bell

Post by gratkowski » Sun Jun 25, 2023 2:46 pm

found it myself: [bach.eval $i = 0 ; while $i < $x1 collect ($i += 1) + $x2]

Post Reply