Question: Hi, I am a new Scheme Learner, Can anyone help with coding for the definition of (repeat-rows, append-cols, append rows, flip-cols and flip-rows)? 1. (define

Hi, I am a new Scheme Learner, Can anyone help with coding for the definition of (repeat-rows, append-cols, append rows, flip-cols and flip-rows)? Hi, I am a new Scheme Learner, Can anyone help with coding

for the definition of (repeat-rows, append-cols, append rows, flip-cols and flip-rows)? 1.

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. )) ii; repeat-rows returns a figure made up of nrepeat copies ii; of a figure, appended vertically (above and below each other) (define (repeat-rows nrepeat figure) ';; replace this line with code ;;; append cols returns the figure made by appending figureb to the ii; right of figurea the number of rows in the resulting figure is the ii; smaller of the number of rows in figurea and figureb (define (append-cols figurea figureb) '() ;; replace this line with code ) ;;; append-rows returns the figure made by appending figureb below figurea iii the number of columns in the resulting figure is the smaller of the number of columns in figurea ii; and figternb (define (append-rows figurea figureb) '() ;; replace this line with code ) iii flip-cols returns a figure that is the left-right mirror image of figure (define (flip-cols figure) '() ;; replace this line with code ) ;;; flip-rows returns a figure that is the up-down mirror image of figure (define (flip-rows 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. )) ii; repeat-rows returns a figure made up of nrepeat copies ii; of a figure, appended vertically (above and below each other) (define (repeat-rows nrepeat figure) ';; replace this line with code ;;; append cols returns the figure made by appending figureb to the ii; right of figurea the number of rows in the resulting figure is the ii; smaller of the number of rows in figurea and figureb (define (append-cols figurea figureb) '() ;; replace this line with code ) ;;; append-rows returns the figure made by appending figureb below figurea iii the number of columns in the resulting figure is the smaller of the number of columns in figurea ii; and figternb (define (append-rows figurea figureb) '() ;; replace this line with code ) iii flip-cols returns a figure that is the left-right mirror image of figure (define (flip-cols figure) '() ;; replace this line with code ) ;;; flip-rows returns a figure that is the up-down mirror image of figure (define (flip-rows figure) '() ;; replace this line with code )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!