From 45cfc4ad5e84d0dcd640e124d2e4a99adf0e903d Mon Sep 17 00:00:00 2001 From: Isaac Date: Wed, 14 Sep 2022 09:31:41 -0300 Subject: [PATCH] Current progress in lab. Comitted in non working state, will work on changes/lab later at home. --- {L02 => labs/L02}/hello.rkt | 0 {L02 => labs/L02}/hello.rkt~ | 0 labs/L03/first-rest-pattern.rkt | 23 +++++++++++++++++++++++ labs/L03/first-rest-pattern.rkt~ | 1 + 4 files changed, 24 insertions(+) rename {L02 => labs/L02}/hello.rkt (100%) rename {L02 => labs/L02}/hello.rkt~ (100%) create mode 100644 labs/L03/first-rest-pattern.rkt create mode 100644 labs/L03/first-rest-pattern.rkt~ diff --git a/L02/hello.rkt b/labs/L02/hello.rkt similarity index 100% rename from L02/hello.rkt rename to labs/L02/hello.rkt diff --git a/L02/hello.rkt~ b/labs/L02/hello.rkt~ similarity index 100% rename from L02/hello.rkt~ rename to labs/L02/hello.rkt~ diff --git a/labs/L03/first-rest-pattern.rkt b/labs/L03/first-rest-pattern.rkt new file mode 100644 index 0000000..bd430de --- /dev/null +++ b/labs/L03/first-rest-pattern.rkt @@ -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"))) \ No newline at end of file diff --git a/labs/L03/first-rest-pattern.rkt~ b/labs/L03/first-rest-pattern.rkt~ new file mode 100644 index 0000000..c6c9f31 --- /dev/null +++ b/labs/L03/first-rest-pattern.rkt~ @@ -0,0 +1 @@ +#lang slideshow \ No newline at end of file