;;; Name: ;;; ps3.ss ;;; UVA CS200 Spring 2003 ;;; Problem Set 3 ;;; (load "lsystem.ss") ;;; ;;; Question 1: ;;; ;;; ;;; Question 2: ;;; (define (is-forward? lcommand) #f ;;; replace this with your code ) (define (is-rotate? lcommand) #f ;;; replace this with your code ) (define (is-offshoot? lcommand) #f ;;; replace this with your code ) (define (get-angle lcommand) #f ;;; replace this with your code ) (define (get-offshoot-commands lcommand) #f ;;; replace this with your code ) ;;; ;;; Question 3: ;;; (define (rewrite-lcommands lcommands replacement) (flatten-commands (map ; Fill this in with procedure to apply to each command lcommands))) ;;; ;;; Question 4: ;;; ;;; num-points p n ;;; p is the number of t-value points left ;;; n is the number of curves left (define (num-points p n) (if (= n 1) ;;; If there are no curves left, p ;;; this curve gets all the remaining points. 0)) ;;; Otherwise, the rest of the curves get half the remaining points. ;;; <<< Replace the 0 to with the correct expression. ;;; ;;; Questions 5 and 6: ;;; (define (convert-lcommands-to-curvelist lcommands) (cond ((null? lcommands) (list (lambda (t) (make-colored-point 0.0 0.0 (make-color 0 255 0))) ;;; A leaf is just a point. )) ((is-forward? (car lcommands)) (cons-to-curvelist vertical-line (convert-lcommands-to-curvelist (cdr lcommands)))) ((is-rotate? (car lcommands)) ;;; If this command is a rotate, every curve in the rest ;;; of the list should should be rotated by the rotate angle (let ;; L-system turns are clockwise, so we need to use - angle ((rotate-angle (- (get-angle (car lcommands))))) (map (lambda (curve) (rotate-around-origin ;;; Question 5: fill this in ) ) ;;; Question 5: fill this in ))) ((is-offshoot? (car lcommands)) (append ;;; Question 6: fill this in )) (#t (error "Bad lcommand!")))) ;;; ;;; Question 7: ;;; (define (make-lsystem-fractal replace-commands start level) #f ;;; Fill this in ) ;;; ;;; Question 8: ;;;