Computer Games for Kids, by Kids - Part 2
...continued
Conversations
Everyone, certainly by the age of ten, is an
expert at conversation. Fifth graders have had
years of practice fine tuning their conversational
skills. They have experimented with new vocabulary,
humor, and sarcasm. Making conversation a
programmable activity forces students to explore
their conversations deeply. They must deconstruct
and examine spoken conversation and recognize its
elements.
Writing an interactive conversation is a natural
follow-up to the Madlibs project. It builds on the
concepts learned in Madlibs: variables, Logo
syntax, and English grammar. But most of all, it's
a good introduction to the study of logic.
Our class spends about three weeks (6 double
periods ) writing conversations. Students are given
this starter to work from.
The Starter
- to
conversation
- announce
[Hello there. Ready to talk?]
- question
[Who are you?]
- name
answer "person
- question
(se
(word
:person
",) [are you working hard
yet?])
- If equal?
answer "yes
- [announce
(se
[Glad to hear that]
:person)]
- If equal?
answer "no
- [announce
[I have a feeling that will change real
soon!]]
- question
(se
[Did you have pizza today for lunch,]
(word
:person
"?))
- Ifelse equal?
answer "yes
- [announce
[Yes? Lucky you - it's my favorite
lunch!]]
- [announce
[No? I guess they didn't offer it
today!]]
- question
(se
(word
:person
",) [what is your favorite
animal?])
- name
answer "animal
- ifelse
member?
:animal
[dog puppy dogs puppies]
- [announce
[I love dogs! I have a big apricot crazy
poodle!] ]
- [announce
(se
[The]
:animal
[is one of my favorite
animals.])]
- question
(
se
(word
:person
",) [how old are you?] )
- if equal?
answer 10
- [announce
[ Ten! You are one decade old!]
]
- if equal?
answer 11
- [announce
(se
[ Eleven! ]
word
:person
", [you are probably one of the oldest girls
in this class.]]
- if less?
answer 10
- [announce
(se
answer [is pretty young]
]
- if greater?
answer 11
- [announce
(se
answer [is kind of
old!]) ]
- announce
(se
[You're done with this conversation]
(word
:person
".) [Try it again using different
answers.])
- announce
[After you try it a few times, look at the
procedures page to see the
programming.]
- announce
[You may add on to this conversation or
start a new one.]
- end
Color Coding
Procedures
We have used text color in order to
improve the readability of the
conversation programs.
Words in blue are procedure calls.
Dark blue
words are the names of primitives.
Light blue is
for user-defined procedures.
Red is for
variables. These words are always preceded
by a colon or "dots" in traditional Logo
terminology.
Green is
for the special words
to and
end.
Everything else is in black -- the
literal text that is the substance of the
conversation itself.
|
Getting Started with the
Starter
The fifth graders begin programming their
conversations by first changing the inputs to
question and if.
Then they add new questions of their own. When the
contents inside the instruction list becomes
complicated, we suggest moving those instructions
to a subprocedure. For example, in the
talk procedure below, if the
player does have siblings, the program calls the
yessibs procedure where more
questions are asked and further branching is
required. Using subprocedures makes the programming
code neater and easier to read.
- to
talk
- question
(
se
(word
:person
",) [Do you have any siblings?]
)
- if equal?
answer "yes
- [yessibs]
- if equal?
answer "no
- [announce
[that's ok]]
- announce
[bye]
- end
-
-
- to
yessibs
- announce
[I have a sister]
- question
(
se
(word
:person
",) [Do you have a sister?] )
- ifelse equal?
answer "yes
- [yessister]
- [yesbrother]
- end
-
- to
yessister
- announce
[that's great.]
- question
[How many do you have?]
- announce
[oh]
- question
[Do you have any brothers]
- if equal?
answer "no
- [announce
[that's ok]]
- if equal?
answer "yes
- [question
[How many do you have?]
announce
[oh]]
- end
-
- to
yesbrother
- announce
[oh you must have a brother.]
- question
[How many do you have?]
- announce
[oh]
- end
Bugs
A missing or mismatched bracket is the most
frequently occurring bug. The MicroWorlds error
message reports only that a bracket is missing. On
close inspection, the problem may turn out to be
the presence of an extra bracket rather than a
missing one. In the Macintosh version of
Logowriter, looking for a missing bracket was much
easier. A flip to the Procedures Page would place
the cursor on the line with the missing bracket.
MicroWorlds doesn't have that feature. A trained
eye can pick it out more quickly, but students rely
on other strategies for finding where the problem
is.
One approach is to insert end
after a few lines of code and exit the Procedures
Page to see if an error message appears. If all's
clear, go back to the Procedures Page and move
end a few lines down. Repeat until
the problem spot is found.
Variables
Examining their use of variables reveals that
students don't always fully comprehend when it's
necessary to use them.
The primitive question displays
a dialog box with the text of the question you
specify, and a space to type in a response. The
primitive answer then reports what
was typed in response to the most recent
question. This string of text can
be given a name as in this snippet of
conversation:
- question
se
:person
[what is your favorite
dessert?]
- name
answer "dessert
- announce
[Great!]
In this case, using the variable
dessert is unnecessary unless the
response to this question will be needed later in
the program. In fact, since the reply is just
"Great!" and doesn't depend upon the response to
the question, the program could have been
- question
se
:person
[what is your favorite
dessert?]
- announce
[Great!]
Answer would be
needed in a case like this:
- question
se
:person
[what is your favorite
dessert?]
- announce
(se
[Great! I like]
answer
[also])
If someone typed in "Apple Pie" in response to
the question, the program would
announce "Great! I like Apple Pie
also."
The program could also be written like this:
- question
se
:person
[what is your favorite
dessert?]
- name
answer "dessert
- announce
(se
[Great! I like]
:dessert
[also])
Using the variable dessert
isn't necessary. However, many fifth graders do
create variables throughout their conversations
regardless of necessity. It seems that they are
over-applying the rule. Often when when learning a
new language, whether it is a 2-year-old learning
to speak her native language or an adult learning a
second language, one tends to apply grammatical
rules to everything until one learns the exceptions
and develops a better understanding of how the
language works.
Here's a case where using the variable
dessert would be necessary:
- question
se
:person
[what is your favorite
dessert?]
- name
answer "dessert
- announce
(se
[Great! I like]
:dessert
[also])
- question
[What's another dessert you
like?]
- name
answer "dessert2
- announce
(se
[I like]
:dessert
[better than]
:dessert2)
The second question causes Logo to remember a
new answer and to forget the first one. To remember
the first answer, it needs to be assigned to a
variable. However, the second answer did not have
to be assigned to
dessert2. The program
could be
- question
se
:person
[what is your favorite
dessert?]
- name
answer "dessert
- announce
(se
[Great! I like]
:dessert
[also])
- question
[What's another dessert you
like?]
- announce
(se
[I like]
:dessert
[better than]
answer)
-
When using subprocedures, assigning variables to
answer is more critical. When the
program switches into a subprocedure,
answer is still reporting the
response to an old leftover
question that may have been asked
way back in the program. If the programmer is
looking for the bug only in that subprocedure it
won't be found.
Logic
Logic is about decision-making based on
conditions. In writing their conversations students
are setting up the conditions and thinking in terms
of what is true and false. They must decide what
happens once those conditions are met, or not met.
Additionally, they must decide how to construct the
instructions. Should they use if
or ifelse, and how many
if statements would cover the
range of possible answers to the question?
If takes two inputs, the first
input is the condition, which reports "true" or
"false." The second input is the instruction list
to run if the condition is true. If the condition
reports "false," nothing is run and the program
continues onward. Ifelse seems to
be a more difficult command for students to grasp
than if because there is one more
piece to keep track of. In ifelse,
if the condition reports "false," the second
instruction list is run. For some students,
creating instructions for "true" and "false"
conditions is easier to do as two separate
instructions.
It's a challenge to reproduce real dialogue. It
is impossible to predict all the responses a player
may type in. We discuss with the students ways to
control the range of possible answers. The starter
includes the instructions
- question
[what's your favorite animal?]
- ifelse
member?
:animal
[dog puppy dogs puppies]
- [announce
[I love dogs! I have a big apricot crazy
poodle!] ]
- [announce
(se
[The]
:animal
[is one of my favorite
animals.])]
Member?, which reports whether
or not its first input is a component of its second
input, is used here to accept variations of
"dog."
Sometime students will specify restrictions for
the response. For example - in Selena's IQ test,
she asks:
- Question
(se
[ OK ]
:nom
[ Who was the first governor of Plymouth?
Hint- He was governor for 31 years. First name
only!!])
And sometimes, the answer requires more than
"yes" or "no." In the example below, this student
added the condition of "sometimes" to her statement
after having her friends test her conversation.
- question
(
se
(word
:person
",) [Do you listen to Z100?] )
- if equal?
answer "yes
- [announce
[Don't they play good
songs.]]
- if equal?
answer "no
- [announce
[You should start
listening.]]
- if equal?
answer "sometimes
- [announce
[you should start listening all the
time.]]
Elements of a Good Conversation
by Hope Chafiian
On a personal note - working with
students on these conversations has made
me more aware of conversations I have with
others. Especially when the conversation
becomes strained, I begin breaking it down
question by answer. For example, when I
returned home from a dinner date, the
conversation we had kept running through
my head. I began to analyze the dialogue
and apply the elements we discuss in
class. I realized two important
things:
- My responses didn't alter the
direction of the conversation.
- When my statements were responded
to, the responses were slightly off.
The person missed the point I was
trying to make. It was as if I were
conversing with a computer, and the
computer was programmed to recognize
key words and output set
responses.
Being over ten years old and therefore
an experienced conversationalist, I
believe there is a conversation continuum
where at one end rests "boring" and the
other end rests "interesting." Tone and
the relationship between the questions,
and responses are two important elements
that determine where the conversation lies
on that continuum. Other elements also
affect the conversation continuum, like
humor and sarcasm, but they won't be
included in this discussion.
Tone is easy to hear in spoken
conversation and we're getting used to
"seeing" it in written conversation as
well. In written dialogue, especially
e-mail, tone can be expressed by the font
of the text. Size, case and style help us
"hear" a conversation better. However,
text formatting cannot be altered in the
dialogue boxes of MicroWorlds and
therefore cannot be recognized in a Logo
conversation. In a Logo conversation we
must focus on the relationship of the
questions and answers by carefully
thinking through the conditional
statements and using subprocedures.
In the example below, notice how the
answer in the first question has no
bearing on what comes next.
- question
(
se
(word
:person
",) [What Do you like to do the
most?] )
- announce
[That's great.]
- question
(
se
(word
:person
",) [What is your favorite TV.
show?] )
- announce
[I love that show
too.]
It's interesting to discuss
conversations in this way with ten and
eleven year olds. To accentuate this point
in class, we practice speaking boring
conversations out loud, and then we do the
conversation over again, with the same
questions but with interesting
responses.
|
|