#python from random import choice t = "" s = " ▁▂▃▄▅▆▇█" z = 0 for i in range(5000): z += choice([-1, 1]) if z < 0: z = z + 2 elif z >= len(s): z = z - 2 t += s[z] print(t)
t=''; s=[...' ▁▂▃▄▅▆▇█']; z=0; for(var i=0;i<5000;i++) { z+=1-2*(Math.random()*2|0); if(z<0){z=z+2;}; if(z>s.length-1){z=z-2;}; t+=''+s[z]; } t;

Feb 6, 2022 · 11:18 AM UTC

3
12
5
108
Let it be known that using += to build a string is generally slower — scales worse — than appending items to a list and joining the parts at the end.
12
Replying to @justvanrossum
This random walk output has an organic feel, suggesting that there is signal in the noise, when in fact, there is none.
4