PG: Change. I still have great reservations about the pedagogy. We are telling kids, step by step, how to do something before they have a picture of what they're trying to control. At least two other alternatives: create tree governed by size (as we do in Unit 1 or 2) and embed, /then/ show how one might want to control growth by count rather than size; create tree by abstract model (trunk, branch, and leaf, which is also the base case) showing structural similarities and differences. Neither of these succeeds in getting to the generic "formula"—stop rule dependent on decrementing input, body, recursive call—but, in my mind, that's a culmination, not a place to start.
We need to add pink boxes to this whole unit. --MF, 4/3/19
The branching pattern on many plants has fractal structure: the smaller parts are like miniature copies of the whole plant.
tree 1
to draw the branches in tree 2
is using abstraction.tree 1
stops running. Why is that essential for tree 2
to work?tree 3
block that uses the tree 2
block as branches.tree 4
block that uses the tree 3
block as branches.tree 5
block that uses the tree 4
block. Running These blocks all look essentially the same except that tree 5
uses tree 4
, while tree 4
uses tree 3
, and so on. So it makes sense to wonder if we can replace all these blocks with a single tree
block, using a variable for the number that changes.
tree
. Build it:tree level: 9 size: 50
. It doesn't work yet. All you see is:
tree 1 size: (size)
, so that it later changes the hard coded numbers into a variabletree (level) size: (size)
. Then text needs to be brought in line.