On Thu, 22 Apr 2010, João Pais wrote:
before I start programming wanted to ask: does anyone knows / has made any patches to populate an array with values? something like "make 10 values between X and Y", being at a constant rate, or following an exponential curve, or with (more or less) random deviations, ...
[#for 0 10 1] | [# something...] <- put function here | [#to_list] | [list prepend 0] | [s $0-myarrayname]
or
[#for 0 10 1] | [#to_list] | [list-map]x[something...] <- put function here | [list prepend 0] | [s $0-myarrayname]
and so on.
if you want random distributions, then those are defined in many more parameters than just an average value and an average deviation from that value. there are as many kinds of randomness as there are kinds of everything else. You can generate independent randomness (each sample is separate from each other) or you can make them related (random walks, markov chains, and more). First, you need to know what kind of effect you'd like to achieve or what you'd like to imitate, and after that, I can help you some more...
simple random walk in gridflow :
[#for 0 10 1] | [# put 2] | [# rand] | [# * 2] | [# - 1] | [#scan +] | [#to_list] | ...
first two boxes do the same as a «10 # 2» message in this case, because we just need to send the value «2» ten times to the randomizer, to flip a coin ten times...
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801