Random instance with a fixed value before calling this the first time.The original Rogue level algorithm picks a width for each room between 4 and 25, and a height between 4 and 7.
Ignoring "gone" rooms, that gives 22^9 * 4^9 possibilities with only a 32-bit seed. So some combinations of rooms must be impossible! How does the subspace of rooms produced by the limited seed space compare with the theoretical distribution if rnd() was really random?
Weekend project, maybe? I have been thinking ever since #RoguelikeCelebration about how small RNG seeds (or poor PRNG algorithms) limit the expressive range of PCG in ways that might be unexpected.
The how behind this:
1⃣ Stacking multiple semi-transparent layers increases their alpha where they overlap https://css-tricks.com/adventures-in-css-semi-transparency-land/
What the individual layers look like one under another below 👇
Stacking them increases the overall alpha so that, in some areas, it's > .5
A bit more on the pseudo-randomness effect given by the prime number of px `background-size` https://css-tricks.com/cicada-principle-css/
#css #alpha #cssGradient #gradient #code #coding #frontend #webDev #webDevelopment #cicada #pseudoRandom
Challenge: Given a 33 bit shift register based random number generator, shifting 32 times to make a random integer, we observe that a given value will always appear twice in the sequence. Generally unevenly spaced. How to find a value which has the closest repeat?
We could run for 2^33 iterations and keep a record in a many gigabyte array, but I imagine there's a better way.
Boosts OK!