Date: 2012-08-08 10:48 am (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
The first thing that springs to mind is exponentiation mod a prime, i.e. compute g^input mod p, where p is prime and g is a primitive root. If p is of the order of a machine word then that shouldn't be too expensive (modular exponentiation is the slow step in asymmetric crypto but that's because the modulus is thousands of bits long). Of course that still has a period of p-1, so if you eventually want to narrow down to a number from 0,...,N-1 where N is the number of distinct grass tiles you could be bothered to draw, I'd imagine a sensible plan would be to pick p such that it's congruent to 1 mod N but about the size of a machine word rather than just N+1. Then you compute (g^input mod p) mod N, and your results should be equidistributed across all outputs but (due to discrete log problem being a pain) lack obvious patterns.

There may be a simpler and faster option still, but that's what I'd try first.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org