Now, we'll see how easy it is to import an existing text file to a Scratch list called answers. You can use any answers you want, but I'm going to use a list of the common Magic 8-Ball responses available via Wikipedia at http://en.wikipedia.org/wiki/Magic_8_ball. My list will contain 20 answers to start.
Let's follow the given steps for importing fortunes to a list:
Create a new list for the teller called
answers
.Build a plain text file with the answers you want to use in response to the seeker's questions. Enter one answer per line in a plain text editor. The following screenshot shows my list of answers. The book's source files will include a sample
answers.txt
file.To import the list, right-click on the answers list monitor and choose import. This will erase any items you previously added to the answers list.
In the Import List dialog box, browse to the answers text file you saved on your computer prior to starting this exercise and select...