- Try chatting. How does the behavior compare to version 4 of Magpie:
- At the bottom of the Magpie5 Lab find the code:
private String [] randomResponses = {"Interesting, tell me more", "Hmmm.",
"Do you really think so?",
"You don't say." };
This array of Strings holds the responses the ChatBot randomly says. Add two more random responses and compile, then run the runner for Magpie5.
- Look at the getRandomResponse method in the Magpie5 Lab and compare it to the same method in the getRandomResponse method in Magpie4. Compare and contrast how the two methods work.
- Let's say you wanted to increase the number of random responses to 30 different phrases. Which of the two methods, the one in Magpie 4 or Magpie5, would be most efficient? Why?
- How does storing the responses in array enable increasing the number of random responses the Magpie ChatBot can use?