Connie
Connie

Reputation: 259

Racket Slideshow 2Htdp Pict

I am trying to try and create an image using racket. I want to try and make a waffle but I can't seem to figure it out. This is my code:

#lang slideshow

(require 2htdp/image)

(define (waffle img)

    (define two-p (hc-append img (rectangle 10 10 "solid" "white") img (rectangle 10 10 "solid" "white") img))

    (vc-append two-p (rectangle 10 10 "solid" "white") two-p (rectangle 10 10 "solid" "white") two-p))

(circle 35 "solid" "yellow")

(waffle (rectangle 10 10 "solid" "brown"))

I want to overlay the rectangles onto the circle. How should I do this? Am I using the correct libraries or should I use a different one?

Upvotes: 1

Views: 123

Answers (1)

Connie
Connie

Reputation: 259

I managed to solve it by using cc-superimpose! My code now looks like this:

#lang slideshow

(require 2htdp/image)

(define (waffle img)

  (define two-p (hc-append img (rectangle 10 10 "solid" "yellow") img (rectangle 10 10 "solid" "yellow") img))

  (vc-append two-p (rectangle 10 10 "solid" "yellow") two-p (rectangle 10 10 "solid" "yellow") two-p))

(cc-superimpose

 (circle 37 "solid" "yellow")

 (waffle (rectangle 10 10 "solid" "brown")))

Upvotes: 1

Related Questions