I'm trying to make the Perlin noise algorithm described at http://freespace.virgin.net/hugo.elias/models/m_perlin.htm using Lua. However, it doesn't work properly since Lua doesn't support bitwise operators, which are necessary for the pseudorandom number function on that page. I tried messing around with randomseed() but everything I could come up with just made really bizarre patterns. I need a pseudorandom number generator that will generate numbers between -1 and 1 when given the parameters x, y, and a random seed. Pseudocode is fine.
Thanks!