Tuesday, February 10, 2009

Chapter 9 -- Page 314 -- Listing 9.4

The recursive calls to sierpinski in lines 14,15, and 16 have an extra comma at the end of the parameter list as shown below.
sierpinski(myTurtle,p1,midPoint(p1,p2),midPoint(p1,p3),depth-1,)
sierpinski(myTurtle,p2,midPoint(p2,p3),midPoint(p2,p1),depth-1,)
sierpinski(myTurtle,p3,midPoint(p3,p1),midPoint(p3,p2),depth-1,)
This is a typo.  Although these extra commas do not cause any syntactic problem, they should be removed.

No comments:

Post a Comment