The pattern of using an index variable to process a bunch of values is pretty common in programming, and is not specific to lists alone! The block on the left below is the one that we used to say all of the names in our player list. The block on the right can be used to say all of the letters in a sentence like Go Bears!
.
There are striking similarities between the two scripts, and so we should be able to perform the same tasks on sentences as those we did on lists. Write blocks that make the character say the following:
repeat until
or a repeat
block.Often, when writing a script, if we have already written a similar script for another purpose or data structure, we can either modify the script for the new functionality, or we can create a more general function that can be used for both purposes. Do as many exercises as you need, until you feel really comfortable with this general pattern of code, because it is very common.