Question: Racket Code I need help completing this racket code. What I have currently is a code that creates a checkerboard but its all squares that
Racket Code I need help completing this racket code. What I have currently is a code that creates a checkerboard but its all squares that are red and black. Now what I want is a checkerboard but its circles that are red and black rather than squares. See bottom of the question for how I want the output to be Code: #lang slideshow
(define c (circle 10)) (define r (rectangle 10 20)) (define (square n) ; A semi-colon starts a line comment. ; The expression below is the function body. (filled-rectangle n n))
(define (four p) (define two-p (hc-append p p)) (vc-append two-p two-p))
(define (checker p1 p2) (let ([p12 (hc-append p1 p2)] [p21 (hc-append p2 p1)]) (vc-append p12 p21)))
(define (checkerboard p) (let* ([rp (colorize p "red")] [bp (colorize p "black")] [c (checker rp bp)] [c4 (four c)]) (four c4)))
////// How the output should be:
Welcome to DrRacket, version 7.6 [3m). Language: slideshow, with debugging, memory limit: 128 MB. > (checkerboard (filled-circle 20)) >|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
