(define title "Snake Game") ;; We have figured out the constants of the Snake world. ;; We have settled on a data representation for the Snake world and all of ;; its pieces. ;; It's time to create a wishlist of functions. (define-struct world (snake food)) (define-struct food (x y)) (define-struct snake (dir seg)) #| ----------------------------------------------------------------------------- Snake World ---------- World is a structure: (make-world Snake Food) Food is a structure: (make-food Number Number) Snake is a structure: (make-snake Direction Segments) Direction is one of the following symbols: -- 'up -- 'down -- 'left -- 'right Segments is one of: -- empty -- (cons Posn Segments) |# ;; Start with the world, when you make up a wish list, the others will fall ;; out. This should suggest something like that. ;; world-draw : World -> Image ;; world-move : World -> World ;; snake-draw : Snake -> Image ;; snake-move : Snake -> Snake ;; snake-change-direction : Snake Direction -> Snake ;; snake-eat : Snake Food -> Snake ;; food-draw : Food -> Image ;; Add purpose statements. Then pick a place and start.