So let me explain my problem a little better now (please reopen this question). I heard of markov chain theory when thinking about a method to generate procedural lines to build terrain.
The main thing that’s generated is the
map which can extend to infinity. At
first I’ve built a demo with
perlin-based procedural maps having a
lot of various terrain features. It
was even meant to be isometric, more
like Sentinel. This
proved to be too confusing to play on
with the movement mechanics I had in
mind. I had to reduce it to a much
simpler tile based system. It’s not
only easier to grasp and navigate but
it’s looking a lot better too.The map is generated using the Markov
chain. The algorithm is fed a short
human made terrain sequence. It then
goes on and produce a map of any size
mimicking the structure of the input.
So an example visual output may look like you see in the following image

Actually I experienced a similar thing that is described in the quotation ending up with this random lines:

So instead of having this random line I look for a solution to create little canyons from the first picture. First time I read about markov chain I thought WOW, take a human made line as input and let the algorithm proceed, sounds brilliant.
So how does markov chain theory actually help on creating this kind of terrain? If you think there is a better way to do this please suggest.
The map is generated using the Markov
chain.
…confused me and I tought their actually is a markov chain algorithm.
I’m not sure if you know what a Markov chain is. A Markov chain is a system defined by state transitions based on probabilities. The next state is (by definition) based on the previous state.
A Markov chain is not a transform. It’s not an algorithm for the modification of a system, it merely describes the system.
To describe your line system, you need to look at individual indices in your array and calculate the probability of a “jump”. In the end, you’ll be left with something akin to this:
This is trivial to program, but it does not aid you in making the lines straight. To make the lines straight, you don’t even need a Markov chain, just iterate over all indices and make them equal to the previous index. It’s difficult to see exactly what you’re trying to do here.