View the step-by-step solution to:

;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our...

I attached a file with Dr.Racket and was wondering if you can help me figure out why these check-expects are not working when they are literally telling me it expects exactly what it has.

;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname proj2) (read- case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating- decimal #f #t none #f () #f))) (require racket/gui) (define-struct game ( snake food tick)) ;; Game is (make-game snake good Number) ;; interp. a game is made of a snake food and a natural number #; (define (fn-for-game agame) (... (game-snake agame) ; Snake (game-food agame) ; Food (game-tick agame))) ; NaturalNumber (define-struct snake (direction body)) ;; Snake is (make-snake Direction Body) ;; interp. a game is made of a direction and a body #; (define (fn-for-snake asnake) (... (snake-direction asnake) (snake-body asnake))) (define SNAKE1 (make-snake 'up (list (make-posn 25 25) (make-posn 25 24) (make-posn 25 23) (make-posn 25 22)))) (define SNAKE2 (make-snake 'left (list (make-posn 3 40) (make-posn 4 40) (make-posn 5 40) (make-posn 6 40) (make-posn 7 40)))) (define game-start (make-game SNAKE1 (list (make-posn 3 37) (make-posn 15 20) (make-posn 1 1) (make-posn 44 9)) 45)) ;; place-food (define (place-food agame aposition) (make-game (game-snake agame) (cons aposition (game-food agame)) (game-tick agame))) #|(check-expect (add-food game-start (make-posn 4 34)) (make-game SNAKE1 (list (make-posn 4 34) (make-posn 3 37) (make-posn 15 20)
Background image of page 1
(make-posn 1 1) (make-posn 44 9)) 45)) |# (define (change-direction agame adirection) (make-game (make-snake adirection (snake-body (game-snake agame))) (game-food agame) (game-tick agame))) (check-expect (change-direction game-start 'left) (make-game (make-snake 'left (list (make-posn 25 25) (make-posn 25 24) (make-posn 25 23) (make-posn 25 22))) (game-food game-start) (game-tick game-start))) ;; a direction is either ;; - up ;; - down ;; - left ;; - right
Background image of page 2
Sign up to view the entire interaction

Top Answer

You need to remove the # before you execute.... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online