
On Fri, Nov 28, 2008 at 10:53:32PM +0100, Torsten Otto wrote:
Hi all,
I teach a high school class in Computer Science. The current programming goal is to implement chat-bots, and we're using Haskell of course. Now one of my students had the seemingly easy idea of having the bot answer with a random sentence if it doesn't have "good" answer.
Perhaps instead of using a random number, you could simulate randomness with some other technique. For example, if there is no good response in a particular situation, you could hash the input and map it to some predetermined responses. This would keep you in the IO monad (I think. I'm a total rookie at this). You could then useit as a vehicle to teach some other stuff such as the meaning of random in a computer environment (vs true randomness) and concepts of hashing (even looking into collisions in a simple way because the students will see that different situations reliably give rise to the same outout). .02 A