
If we wanted put it in Haskell terms we'd say something like this: runTheGenerator :: SeedValue -> ( Output, SeedValue)

Then some sort of math is done to make a random-seeming number and the next seed. Our seed might come from some sort of entropy source, it might come from a number that the user typed in for us to use, we might just get lazy and use the system clock, something like that.
#PCGEN REDDIT GENERATOR#
A pseudo-random number generator takes some initial data, some initial amount of bits, which is called the seed. A pseudo-random number generator is the sort of thing where you say to yourself, "as long as me and my friends (or enemies) can't predict the next value from just looking at the other values so far, that's probably good enough, right?" And, indeed, it pretty much is good enough. How do we go faster? That's where the "pseudo-" comes in. The speed of your random number generation is limited by how fast you get more entropy, and that's far too slow for most purposes. The other trouble is that even when you do it all just right, it's slooooooow. Even then your hardware has to be really good for your inputs to be statistically random. If you take the chaotic data (called entropy) from a hardware source like that and hook it up to a randomization technique you can get a "truly random number generator" (probably, true randomness might not exist in our universe, but some people hope for its existence). That's very hard to do, and pretty much has hardware requirements (usually by measuring the timing of something external to the computer, like user input frequencies, radioactive decays of an isotope sample, cloud movements, or something else like that). You might be used to the phrase "random number generator", and I keep sticking "pseudo-" on the front, so what's that mean? It means that our random number generator isn't actually random in the sense of "entirely unpredictable". I'm not an expert but we can talk about it a bit anyway because at the basic level it's quite simple. They have all sorts of techniques that you might use. There's lots of pseudo-random number generators (PRNGs) in the world.

Of course, there will still be the link to a commit at the end of the week's work as well. If you run into trouble you can check against that commit.

Starting this week, when I pause at a concept and mention that we want to check for a successful compile and run I'll include a link to a specific commit of that point.
#PCGEN REDDIT CODE#
Usually I code ahead a bit and then write things down once I've had some success, so it can be hard to remember every single little change, particularly as we start having more than one file. There was a little mix up last week where I was saying "it should all compile now" but I'd forgotten to talk about some part of some small change I'd made so it didn't actually compile for people following along.
