I love generative art, and I frequently use a pseudo-random function to add a bit of noise to an image or behavior, but every time I implement a pseudo-random number function in JavaScript it takes me a second to remember how this works. So I thought I would write a quick post with a few of the most common pseudo-random number functions (henceforth referred to as simply “random” numbers) implemented in both vanilla ES6 and (just for fun) Python 3 as well. Of course there are infinitely many probability distributions and stochastic processes to explore, but I’ll keep this simple and save some useful concepts like Markov chains and coherent noise for another time.
#javascript #python #random
#javascript #python #random
Hacker Noon
Pseudo-random Beasts and Where to Find Them: A Cheat Sheet for ES6 & Python 3
I love generative art, and I frequently use a pseudo-random function to add a bit of noise to an image or behavior, but every time I…