Well there is an end and it can appear at any level from 11 up to 20. On 20 it HAS to appear but basically it does a random number from 0-9 and it's compared to the map level. If it's less than the map level -10 then it's deemed the final level.

Combat is joined...
You hit the dog.
The dog hit you.
The dog hit you.
You hit the dog.
The dog hit you.
The dog hit you.
You hit the dog.
Looks like you might have hit a decisive blow.
The dog is vanquished!

The only thing that's irritating is that because I didn't make this a proper list of food you have that you pick from, if you pick up a diseased carcass or a dodgy mushroom and get poisoned/hallucinogens, you get immediately, even though it might be ages before you actually eat it. But I'm not about to change it.