After having some fun in a chatbox on a certain website I had an interesting idea. What would be an algorithm that, given some input text, would generate an "echo" text from it. That is, it generates the echo that you would hear if you shouted the input text in a large empty cave. For example:
Input text: Hello!
Output text: Hello!
ello!
lo!
o!
The problem is I don't exactly know what I want myself. I have no idea on how to create such an algorithm or what would even be a criteria to determine if it's a good algorithm. But I suppose the general idea is clear, so I'd like to hear your thoughts.
You don't have to give a complete solution in your answers. Hints of the direction too look in, or just random thoughts about the problem are welcome too.