;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname 2htdp-underlay-xs) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) (require 2htdp/image) (define person (rectangle 100 200 'solid 'blue)) (define hat (triangle 80 'solid 'green)) (define mitten (circle 20 'solid 'red)) (define boot (ellipse 60 20 'solid 'black)) (define (on-head i p) (underlay/xy p (- 50 (/ (image-width i) 2)) (- 0 (/ (image-height i) 2)) i)) (define (on-hand i right? p) (underlay/xy p (- (if right? 100 0) (/ (image-width i) 2)) (- 100 (/ (image-height i) 2)) i)) (define (on-foot i right? p) (underlay/xy p (- (if right? 100 0) (/ (image-width i) 2)) (- 200 (/ (image-height i) 2)) i)) (define person1 (on-head hat person)) (define person2 (on-hand mitten false person1)) (define person3 (on-hand mitten true person2)) (define person4 (on-foot boot false person3)) (define person5 (on-foot boot true person4)) person1 person2 person3 person4 person5