Guest User

Untitled

a guest
Nov 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. (define HEIGHT 800)
  2.  
  3. (define WIDTH 500)
  4.  
  5. (define (sceneblank x)
  6. (place-image blank 400 400 (empty-scene WIDTH HEIGHT "black"))
  7. ;blank being the image
  8.  
  9. (animate sceneblank)
  10.  
  11. (require 2htdp/image)
  12. (require 2htdp/universe)
  13.  
  14. (define HEIGHT 800)
  15. (define WIDTH 500)
  16. (define BLANK-SCENE
  17. (empty-scene WIDTH HEIGHT "black"))
  18.  
  19. ;; This function shows just the circle
  20. (define (add-circle x scene)
  21. (place-image (circle 50 "solid" "red") x 400 scene))
  22.  
  23. ;; This function shows just the square
  24. (define (add-square x scene)
  25. (place-image (square 50 "solid" "blue") x 500 scene))
  26.  
  27. ;; This shows both of them
  28. (define (circle+square x)
  29. (add-circle x (add-square x BLANK-SCENE)))
  30.  
  31. (animate circle+square)
Add Comment
Please, Sign In to add comment