Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

with the given 8 definitions of a project on drawing stars, Can anyone help with the coding for the definition ( paste, rotateCCW, rotateCW and

with the given 8 definitions of a project on drawing stars, Can anyone help with the coding for the definition ( paste, rotateCCW, rotateCW and ExcludeWindow)?

image text in transcribed

image text in transcribed

1. (define (make-figure funs numrows numcols) (list (add-check func numrows numcols) numrows numcols)) (define (figure-func figure) (car figure)) (define (figure-numrows figure cadr figure)) (define (figure-numcols figure cadde figure)) 2 (define (forn start stop func) (if > start stop) 'O (let ((first-value (funs start))) (cons first-value (forn (+ 1 start) stop funs))))) 3. (define (range-check row numrows col numcols) (not (or (=row numrows) (>= col numcols)))) 4. (define (add-check funs numrows numcols) (lambdarow col) (if (range-check row numrows col numcols) (func row col) #1.))) 5. (define (display-window start-row stop-row start-col stop-col figure) (forn start-row stop-row (lambda (1) (forn start-col stop-col (lambda (c) (display ((figure-funs figure) rc)))) (newline) (newline)) 6. (define (charfig char) (make-figure (lambda (row col) char)1 1)) 7. (define (sw-corner size) (make-figure (lambda (row col) (if (>= row col) #* #space) size size)) 8. (define (repeat-cols piepeat figure) (make-figure (lambda (row col) ((figure-func figure) row (modulo col (figure-numcols figure)))) (figure-numrows figure) (* niepeat (figure-numcols figure)) the function just calls the function that repeat-cols received, but uses modulo to select the right position. )) iii paste draws the composition of two figures ;;; any coordinate in range of either figure should draw, and a space should appear only if that is the case for both figures (define (paste figurea figureb) '() ;; replace this line with code ) ii; rotateCcw causes the figure to be drawn with a 90 degree counter clockwise rotation (define (rotateCcw figure) '() ;; replace this line with code ) ii; rotateccw causes the figure to be drawn with a 90 degree clockwise rotation (define (rotatecw figure) '() ;; replace this line with code iii excludewindow excludes some segment of a figure, replacing any character within the figure's normal draw area that is in the exclusion zone with a '#\space' character ;;; the exclusion window is rectangular only (define (excludeWindow minrow maxrow mincol maxcol figure ) '() ;; replace this line with code ) 1. (define (make-figure funs numrows numcols) (list (add-check func numrows numcols) numrows numcols)) (define (figure-func figure) (car figure)) (define (figure-numrows figure cadr figure)) (define (figure-numcols figure cadde figure)) 2 (define (forn start stop func) (if > start stop) 'O (let ((first-value (funs start))) (cons first-value (forn (+ 1 start) stop funs))))) 3. (define (range-check row numrows col numcols) (not (or (=row numrows) (>= col numcols)))) 4. (define (add-check funs numrows numcols) (lambdarow col) (if (range-check row numrows col numcols) (func row col) #1.))) 5. (define (display-window start-row stop-row start-col stop-col figure) (forn start-row stop-row (lambda (1) (forn start-col stop-col (lambda (c) (display ((figure-funs figure) rc)))) (newline) (newline)) 6. (define (charfig char) (make-figure (lambda (row col) char)1 1)) 7. (define (sw-corner size) (make-figure (lambda (row col) (if (>= row col) #* #space) size size)) 8. (define (repeat-cols piepeat figure) (make-figure (lambda (row col) ((figure-func figure) row (modulo col (figure-numcols figure)))) (figure-numrows figure) (* niepeat (figure-numcols figure)) the function just calls the function that repeat-cols received, but uses modulo to select the right position. )) iii paste draws the composition of two figures ;;; any coordinate in range of either figure should draw, and a space should appear only if that is the case for both figures (define (paste figurea figureb) '() ;; replace this line with code ) ii; rotateCcw causes the figure to be drawn with a 90 degree counter clockwise rotation (define (rotateCcw figure) '() ;; replace this line with code ) ii; rotateccw causes the figure to be drawn with a 90 degree clockwise rotation (define (rotatecw figure) '() ;; replace this line with code iii excludewindow excludes some segment of a figure, replacing any character within the figure's normal draw area that is in the exclusion zone with a '#\space' character ;;; the exclusion window is rectangular only (define (excludeWindow minrow maxrow mincol maxcol figure ) '() ;; replace this line with code )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

Students also viewed these Databases questions