Time for action – validating the seeker's question
Now that we're prompting the player for a question via the seeker and adding it to the questions list, it is a good idea to check for some common errors that may come our way. First, we're going to make sure the seeker types something into the textbox when prompted. Secondly, we're going to check for the duplicate questions because receiving different answers for the same question may expose the teller's randomness.
Select the Scripts tab of the teller sprite and let's begin:
- In the when I receive (intro) stack, add a repeat () until block right before the broadcast (fortune) block.
- As we have two conditions to check, insert the () and () block from the Operators palette to the value in the repeat () until block.
- In the first value of the and block, add a greater than (>) block.
- To the first value of the greater than block, add the length of () block from the Operators palette. Then, add the answer block...