Time for action – ensuring grammatically correct questions
We have a good grasp on accessing groups of words as a single item, but this exercise is going to look at the individual characters of those strings. Right now, the teller has a script that starts with the when I receive (intro) block. It ultimately prompts the player for a question and validates the question before issuing the answer. We're going to revise this script. The steps are as follows:
- Detach the broadcast (fortune) block from the bottom of the stack and move it out of the way for now.
- The existing repeat until () block already provides a check for a minimum length and a duplicate question. We can perform a third check by adding a second () and () block to the existing evaluation. You'll need to reconstruct the expression by replacing the not ((questions) contains (answer)) expression with an () and () block. The following screenshot shows the revision:
- To the open value, we want to add the following evaluation...