January 11th, 2014, 08:00 AM
Map generator in C (text mode)
Hi, I'm new in c language (I'm beginner in programming as well). I have to write some program in c on ma IT classes:
Generator of random “maps”, e.g. for a game, represented using characters (“text mode”), with areas of water, grass, trees, hills, and mountains (there could be more). Each type of terrain has an appropriate character. A map is displayed on screen and saved to a file. Map size, land to water ratio, and smoothness of area edges should be user-defined."
I think I can handle this part with displaying and saving, but could You give me some advices/methods/ideas how to solve this last part: "Map size land to water ratio, and smoothness of area edges should be user-defined."
Thanks in advance
January 11th, 2014, 02:48 PM
> "Map size land to water ratio, and smoothness of area edges should be user-defined."
1. Keep a count of how many "L" and "W" symbols you use.
2. For smoothness, consider something like this.
This is smooth, because it has 5 neighbours
This is less smooth, because it only has three neighbours