Hi,<br><br>I'm trying to write a program that draws a polygon from a list of posns by using world.ss. Here is my code so far:<br><br>(define scene (empty-scene 100 100))<br><br>;;example lop<br>(define a (cons (make-posn 10 10) (cons (make-posn 60 60) (cons (make-posn 10 60) empty))))
<br><br>;;data definition world<br>;;scene<br>;;lop: list of posns<br>(define-struct world (scene lop))<br><br>(define connect-dots<br> (lambda (w)<br> (cond<br> [(null? (cdr (world-lop w))) w]<br> [else<br>
(and (place-image (add-line scene (posn-x (car (world-lop w)))
(posn-y (car (world-lop w))) (posn-x (second (world-lop w))) (posn-y
(second (world-lop w)))'black) 0 0 scene) (make-world (world-scene w)
(cdr (world-lop w))))])))<br><br>(big-bang 100 100 0.1 (make-world scene a))<br>(on-tick-event connect-dots)<br><br>This
doesnt give me any errors but it doesnt appear to be doing anything
else either. It's supposed to draw lines by taking two posn values and
then repeating itself untill there is only one pair of posns. The
result should have been a triangle (since there are only 3 posn values)
but instead the canvas is blank. Hopefully you can help point out where
I'm wrong, thanks in advance!<br><br>