If You Give a Mouse a Cookie
Laura Joffe Numcroff
978-0060245863
If You Give a Mouse a Cookie
CT Discussion Companion
Summary:
This is a classic fictional story about a boy’s encounter with a mouse. The boy begins by giving the mouse a cookie. Then the mouse requests milk, but the milk spills, so the mouse requests cleaning supplies, and on and on. This is entertaining because the mouse clearly has the attention span similar to the target audience. It final comes around at the end to asking for a cookie and milk again, and therein lies the tie to computing.
Loops are programming constructs in which a sequence of tasks are repeated over and over again by a computer. However, one of the most critical aspects of this loop is defining when this loop should end, and making sure that each iteration gets the computer closer to this end. This is what the book lacks - all of these disconnected activities appear to be getting to an end, but at the end we see that it all leads back to the beginning again, implying that the same sequence could continue forever.
Discussion Resources:
First discuss plot elements that lead to the idea of making progress towards an end:
-
The boy gets tired during the book. Why does he get tired? [He is tired because the mouse asks him to do / give him so many things.]
-
What do you think the boy is feeling at the very end of the book and why? [Exasperation or even more tired (depending on age) - he keeps thinking the mouse will be finished, but now the mouse asked for the same as the beginning, so it may never end. ]
-
Was the end surprising to you? How did you think it was going to end? [Yes. I thought the mouse would be finished and take a nap.]
Then introduce the idea of programming and a loop.
When programming a computer, you sometimes ask them to do the same thing over and over again (rather than a set of different things that come around). Let’s say we want to program a robot to do something. Tell me what they are doing over and over again and when to stop.
-
Eat a bowl of cereal?
-
Dip spoon into bowl, pick up cereal, put in mouth.
-
When the bowl has no more cereal in it.
-
-
Read a book.
-
Read a page. Turn the page.
-
It reads the last page.
-