Hi, I’m currently using this to generate a random capital letter between A to Z, as follows:
char letter = (char) Random.Range(65, 91);
//Where 'A' is 65 in ASCII
//and 'Z' is 90 in ASCII
//And, reading the documentation, 91 should be ignored, since the (int, int) version of Random.Range ignores MAX
However, for the past ~80 times I’ve run this, I almost always NEVER get an A or Z (or anywhere close to them). Yes, As, Bs, Cs and Xs, Ys and Zs appear, but rarely, VERY rarely, within the first 30 seconds; More often than not its anything in the center, I, T, N, M, J and such, with the letters closest to A and Z appearing only much later down the line.
The sequence does not repeat itself so I’m pretty sure I’m using Random.Range correctly. Besides, IIRC, Random.Range seeds itself on creation and doesn’t need to be explicitly seeded with system time.
Am I just lucky enough to always hit a sequence where min/max hardly appears (I know that’s very possible for a Random, but extreme cases should not be so common!), or is Random.Range biased away from min and max? If so, any alternative that isn’t?