Question: Need help DrRacket Language: DrRacket-> Teaching Languages -> How to Design Programs -> Beginning Student How can I move all objects to different directions? (define

Need help DrRacket Language: DrRacket-> Teaching Languages -> How to Design Programs -> Beginning Student

How can I move all objects to different directions?

(define color1 "red") (define color2 "blue") (define color3 "purple") (define color4 "green") (define s1 (square 80 "solid" color1)) (define s2 (circle 100 "solid" color2)) (define s3 (circle 90 "solid" color3)) (define s4 (square 100 "solid" color4))

(define (main x) (big-bang x (on-tick next) (to-draw draw-world) (on-mouse restart) (stop-when stop?)))

;when click restart (define (restart w x y me) (cond ((mouse=? me "button-down") 0) (else w)))

;to move s1, s2, s3, s4 (define (next world) (cond [(>= world 1000) world] [else (+ world 1)]))

(define (draw-world world ) (place-image s1 world 250 (place-image s2 world 50 (place-image s3 700 world (place-image s4 500 world (empty-scene 800 800))))))

;If I don't put this it's exceed ram limit (define (stop? world) (= world 1000))

(main 1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!