markov chain generation program

c version