Don't print this page. You can read it from the screen as you follow the steps.
Tutorial for Recursive Picture
A face should appear on the left hand side. It is a figure specified by a set of lines, circles, and arcs and by two points that are referred to as the "handles". The handles are the two red dots. Note where they are located with respect to the face.
Press the mouse button down in one location. Continue to hold the button down while moving the mouse. Lift the button in a second location. The figure of the face is translated, rotated, and scaled so that the two handle points of the figure land on the two points that you have specified.
A face should appear on the left and a person with a frame on the right. Note that the face, unlike before, is above the handles.
When "n=base=1", the figure that is on the left hand side is drawn. When "nonbase", the figure on the right is drawn.
Note where the face gets drawn with respect to where you click the mouse. This is because the face when first loaded appeared above the handles.
Note the arrow "---> >---" within the frame box. This specifies a "place to recurse".
Hold down the mouse button at the beginning of the arrow, i.e. "x---> >---", move the mouse to the end of the arrow, i.e. "---> >---x", and lift up the button.
The smaller person has a smaller frame containing a smaller "place to recurse".
You have drawn a "recursive picture". This program draws such pictures automatically. A recursive picture is specified by a "base case" figure, a "nonbase case" figure, by a set of "places to recurse", and by an integer "n". The base case figure is shown on the left hand side of the Edit Mode screen. In this case, it is the face. The nonbase case figure and the places to recurse are shown on the right. The places to recurse are specified by an arrow. In our present example, the nonbase case figure is the person,and there is a single place to recurse. The value n is selected with the circle radio buttons on the right of the draw screen.
A recursive picture is drawn as follows. If n=base=1, then the base case figure is drawn. If n>1, then the nonbase case figure is drawn. As well, the location on the screen (specified by two points) of each place to recurse is determined. Then recursively the same picture is drawn at these locations but with the value n-1.
The best way to understand this is to try it with larger and larger values of n.
With n=2, the person is drawn. Then at the one location to recurse the recursive picture for n'=n-1=1 is drawn. Recall the n=1 picture is the face. Therefore, the face is drawn within the person's frame. Remember what the n=2 picture looks like.
Again the person is drawn. Now, however, at the place to recurse, the n'=n-1=2 is drawn. Remember what the n=3 picture looks like.
Now the n=3 picture is drawn in the person's frame.
Open <Examples:three>. Note what the base and the nonbase case figures are. Go into edit mode and select <nonbase>. Draw a big copy of the picture. Then in each of the four places to recurse draw a smaller copy of nonbase case figure. This produces 16 places to recurse. Again draw an even smaller copy at each of these locations. Repeat this until you get the idea. In order to stop, select <n=base=1> and draw the base case figure at each place to recurse.
Clear the screen and have the program draw the recursive picture. Start with n=base=1. Then n=2, n=3, ... . Each time remember what the previous picture looks like. Then for the next value of n, note how the nonbase case picture is drawn, however, in the "places to recurse" the picture for n-1 is drawn.