Skip to content

Instantly share code, notes, and snippets.

@shakdwipeea
Created May 23, 2018 09:55
Show Gist options
  • Save shakdwipeea/c963c5cce99ea0995cd6f9fce96599de to your computer and use it in GitHub Desktop.
Save shakdwipeea/c963c5cce99ea0995cd6f9fce96599de to your computer and use it in GitHub Desktop.
wheel movement
(require 2htdp/image)
(require 2htdp/universe)
(define background (empty-scene 200 50))
(define width-of-world 200)
(define radius-of-wheel 2)
(define distance-between-wheel (* radius-of-wheel 5))
(define wheel
(circle radius-of-wheel "solid" "red"))
(define SPACE (rectangle 5 5 radius-of-wheel "white"))
(define BOTH-WHEELS (beside wheel SPACE wheel))
(define (render x)
(place-image wheel x 48 (empty-scene 200 50)))
(define (tock x)
(+ 3 x))
(define (main ws)
(big-bang ws
(on-tick tock)
(to-draw render)))
(main -10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment