3 ms·
That sucks. I was thinking of ways to prevent that, but without adding a bunch of ifs it kind of kills the minimalistic approach of the original code.
by XzAeRosho 5y ago
That sucks.
I was thinking of ways to prevent that, but without adding a bunch of ifs it kind of kills the minimalistic approach of the original code.
- snek_case 5y agoYou can have an outer loop that checks how many pixels are set in the avatar and keeps trying to generate a new avatar with a different seed until it's not (rejection sampling). As long as the probability of the avatar being too empty is small it should be fast.
- yoz-y 5y agoThe main problem is probably the color, maybe somehow capping the maximum brightness would be doable.