My tablet is having issues v.v buy cheap things never lasts long and is recharging right now. I couldn't go to sleep for a bit and had nothing else to do so I threw this together.
So here's what you need to do to make it work.
make a new folder.
copy the below into a notepad file and save as whatever with the extension ".html". Make sure it is ".html" and not ".html.txt" which sometimes happens. You'll know because it will have a browser-ish icon rather than a text file icon. Save it in that new folder.
In that same folder and not in a subfolder put the various terrain tile images in there.
If you don't want to change them, just make sure you have them the same title as in the rules you gave and are ".gif"s.
The code will resize them to 16px across currently.
To change the file type or name just find it in the code and alter it to what you want it to be.
To change the 16px thing you need to remove only the following "width=16" and it will then load the images as whatever size the real image is...however you want consistency so I suggest changing the width number rather than removing it.
This is hardly the best, most efficient, or cleanest way of doing this, but it is a 100x100 terrain map grid that follows the forest rule set exclusively to create it.
HTML Code:
<html>
<body>
<table cellspacing="0" colspacing="0" cellpadding="0" border="0">
<tr>
<script>
var i = 0;
var rowcounter = 0;
var total = 10000;
while (i < total) {
var die = Math.floor((Math.random() * 20) + 1);
if(die >= 1 && die <= 2) {
img = "plains.gif";
} else if (die >= 3 && die <= 4) {
img = "scrub.gif";
} else if (die >= 5 && die <= 14) {
img = "forest.gif";
} else if (die == 15) {
img = "rough.gif";
} else if (die == 16) {
img = "hills.gif";
} else if (die == 17) {
img = "mountains.gif";
} else if (die == 18) {
img = "marsh.gif";
} else if (die == 19) {
img = "pond.gif";
} else if (die == 20) {
img = "depression.gif";
} else {
img = "x.gif";
}
document.write("<td><img src=" +img+ " width=16 ></td>");
if(rowcounter == 99) {
if(i == 9999) {
document.write("</tr>");
} else {
document.write("</tr><tr>");
}
rowcounter = 0;
} else {
rowcounter++;
}
i++;
}
</script>
</table>
</body>
</html>