Generate ASCII wilderness map Generate an ASCII wilderness map.

Example output:

................^^^^
..................^^
...^^^^........o....
.....^^^^...........
....................
........o....TT.....
..TTTT..............
TTTT.TTTT....~~~~~~.
..TT..........~~~~~~
....................


Anti-example (don't do this):

....................
...........T........
...^..........oo....
......^.............
....................
..............TT....
T.T.T.T.T........T..
.................T..
T.T.T.T.T..........T
..............TT...T


Rules:


Must be at least 20x10 characters in size
Must be different each run, i.e. random
Must contain continuous and varying shape areas of trees 'T', hills '^' and water '~', most of which should consist of more than 5 cells
The default, ground character is '.'
Must contain at least 2 villages 'o' that are usually not next to each other
Must not contain obvious patterns, such as rectangles or evenly spaced areas - "natural look" is the key
You don't need to explicitly check that the rules are followed (e.g. no need for anti-rectangle logic), but the great majority of the runs (say, 80%) must produce conforming results
With your submission, include an example output


Scoring:

Winner has lowest score from formula: code character count - votes
APL (99 76)

F←⍳S←10 20⋄'.T^~^To'[⊃7⌊1++/(⊂7×F∊{?S}¨⍳2),T×{F∊(?S)∘+¨+\{2-?3 3}¨⍳99}¨T←⍳3]



A bit longer than it needs to be (so that it gives better output) but I'll shorten it when the Golfscript answer comes in.


The GolfScript answer was posted so here's a shorter one. I thought of another (rather obvious, in hindsight) way to shorten it so that the output is not much worse than the original program, and it's even shorter than my original backup plan.

(In the old version, I had five bitfields that I was xor-ing with each other, now I have three that I am adding to each other.) 

I have replaced the example output with output of the new version, of course.

Explanation:


F←⍳S←10 20: size is 20x10, F is a matrix where each element is its coordinates
{F∊(?S)∘+¨+\{2-?3 3}¨⍳99}¨T←⍳5: generate 3 bitfields, by starting at a random coordinate, and taking 99 random steps to a neighbouring field and then setting that bit on. 99 seems high but it often backtracks as it is random. This makes the maps for the areas.
(⊂7×F∊{?S}¨⍳2): Add in two villages.
⊃7⌊1++/: sum the areas, giving a matrix where each number represents a certain type. Cap it at 7, because the villages might appear in another area giving high numbers.
'.T^~^To'[...]: replace each number with the right character. There are 3 possibly overlapping fields so the highest possible value is 6. (3+3)


Example output:

....TTT.TTT...TTT.^^
...TT....TTT....T..^
....T....TT.......^^
...~..o..T..^^...^^.
...~.........^^^^^^^
...~~~~....^^..^^^..
~..~~~......^.^.^^^^
~~.~~~......^^.^^^..
~.~~~~........o.....
~~~~~~..............


and

.....o........~~..~~
..............~~~~~.
.^T.T..........~~.~.
^T~~TTTTTT.......~~~
~~~~TT.TT.T......~~~
^~^TTT....T.....~~~~
^^^^T.....T...T..~~.
^^^^.......TT.T.....
^^^^.........TT.....
^^^^.........o......


Old version:

F←⍳S←10 20⋄G←{F∊(?S)∘+¨+\{2-?3 3}¨⍳99}¨T←⍳5⋄'.T^~^To'[⊃7⌊1++/(⊂7×F∊{?S}¨⍳2),T×{(⊃⍵⌽G)∧~⊃∨/1↓⍵⌽G}¨T]