I've run into a little problem while writing a terrain generator in PASCAL for a Minecraft-type sandbox game.
I am storing all block data in an array of records, each with a "noiseID" entry, which is the data generated by the "PerlinNoise" function, and decides what the block should be.
The PerlinNoise function, however, is not working. I followed the instructions on this site and transferred the code over to pascal:http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
However, the "smoothNoise" function is not working properly. Once called, the program exits with code 217. The output says "range check error", but I don't see how anything is out of range.
Here is the code (download Link):http://www.sendspace.com/file/jd6xvq
0 · ·