> On Mar 22, 2017, at 12:45 PM, Angus <anguscom...@gmail.com> wrote: > > I am a bit stuck on rendering images in a list. > > Here is my code below. > > (require 2htdp/image) > > (define-struct bear-state (x y rotation size)) > > (define MTS (empty-scene WIDTH HEIGHT)) > > BEAR-IMAGE is just a graphic - of a bear. > > (define (render-bear b) > (place-image (scale (bear-state-size b) (rotate (bear-state-rotation b) > BEAR-IMAGE)) (bear-state-x b) (bear-state-y b) MTS)) > > > > (define (render-bears bears) > (cond [(empty? bears) (place-image (square 0 "outline" "white") 0 0 MTS)] > [else > (render-bear (first bears)) ; can render 1 bear > (render-bears (rest bears))])) > > > render-bear works but I can't get render-bears to work. What am I doing > wrong? Any hints?
Rendering bears is quite dangerous. I’m surprised you got even one to work. More than that is just asking for trouble. (Sorry, I’m tired. I do see the problem in your code. I bet you can solve this problem using the stepper, and a test case.) John Clements -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.