|
![](/i/fill.gif) |
Larry Fontaine <lfo### [at] isd net> wrote:
: How can I get a smooth random number, ie, it varies from the last random
: number by no more than a certain amount?
If you mean a linear distribution, that's pretty simple:
#declare Seed = seed(0);
#declare Number = rand(Seed);
#macro NextNumber(maxvariation)
#declare Number = Number-maxVariation+maxvariation*rand(Seed)*2;
Number
#end
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |