Current progress in lab.

Comitted in non working state, will work on changes/lab later at home.
This commit is contained in:
Isaac
2022-09-14 09:31:41 -03:00
parent f826a9c3a3
commit 45cfc4ad5e
4 changed files with 24 additions and 0 deletions

22
labs/L02/hello.rkt Normal file
View File

@ -0,0 +1,22 @@
#lang slideshow
(define c (circle 10))
(define r (rectangle 10 20))
(define (square n)
(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)))

2
labs/L02/hello.rkt~ Normal file
View File

@ -0,0 +1,2 @@
#lang racket
(displayln "hello world")

View File

@ -0,0 +1,23 @@
#lang slideshow
(define (my-map f lst)
(cond
[(empty? lst) empty]
[else (cons (f (first lst))
(my-map f (rest lst)))]))
(define (rainbow p)
(map (lambda (color)
(colorize p color))
(list "red" "orange" "yellow" "green" "blue" "purple")))
(define (rainbow2 p)
(define (color-mapper gr-obj color-list)
(cond
[(empty? color-list) empty]
;[else (cons (colorize gr-obj (first color-list))
; (color-mapper gr-obj (rest color-list)))]))
[eles (cons (colorize))]
)
(color-mapper p (list "red" "orange" "yellow" "green" "blue" "purple")))

View File

@ -0,0 +1 @@
#lang slideshow