>(marroquin 9) #<struct:graphic> >
(define spiral (lambda (angle len n) (if (= n 0) (adjoin) (adjoin (bend angle) (straight len) (spiral angle (add1 len) (sub1 n))))))Rewrite spiral so that it is tail-recursive. You are free to use any helper functions you may require.
(define tree-step (lambda (trunk left-branch right-branch) (adjoin trunk (adorn (adjoin (bend -20) left-branch) (adjoin (bend 20) right-branch)))))Use the Plumbing Graphics function, text, to label the leaves of the tree. Here is what a good (i.e., B letter grade) solution looks like:
> (draw-sexpr (cons 1 (cons 2 0))) #<struct:graphic> >
Here is what an excellent (i.e., A letter grade) solution looks like:
> (draw-sexpr '((1) ((2)) 3)) #<struct:graphic> >
* This webpage is located at http://cs.unm.edu/~williams/cs257/homework5f01.html