Implement a markov chain to do text scrambling based on the example on the book The Practice of Programming