Finish lab 3, correct dates on frog journal
This commit is contained in:
parent
000c412ad5
commit
baf9b933de
@ -1,5 +1,5 @@
|
||||
Title: Lab One
|
||||
Date: 2022-09-12T08:50:12
|
||||
Date: 2022-09-07T08:30:00
|
||||
Tags: cs2163, lab, frog, git
|
||||
In this lab we learned about how to use frog and git, and how to interact with the university git remote.
|
||||
<!-- more -->
|
||||
|
@ -1,5 +1,5 @@
|
||||
Title: Lab Two
|
||||
Date: 2022-09-12T08:43:16
|
||||
Date: 2022-09-12T08:30:00
|
||||
Tags: cs2163, lab, git, racket
|
||||
In this lab we learned more about git, and using racket to draw shapes
|
||||
<!-- more -->
|
||||
@ -28,7 +28,7 @@ You can also use this functionality to define functions, for example, give your
|
||||
In racket you can create what are known as "local bindings" which are functions that are local (belong to) a parent function. You can define these individually with another define function, or to define them by using `let` or `let*`, with the latter letting later bindings use earlier bindings. Both of them let you define more than one binding at once.
|
||||
|
||||
It was also noted how identifiers were scoped within a language, with a function arguemnt being avialable throughout the function, and when a variable is not in scope, it does not "exist" so can therefor be defined again, like in this example
|
||||
```
|
||||
```racket
|
||||
(define (rgb-series mk)
|
||||
(vc-appned
|
||||
(series (lamda (sz) (colorize (mk sz) "red")))
|
||||
|
20
journal/_src/posts/2022-09-14-lab-three.md
Normal file
20
journal/_src/posts/2022-09-14-lab-three.md
Normal file
@ -0,0 +1,20 @@
|
||||
Title: Lab Three
|
||||
Date: 2022-09-14T08:30:00
|
||||
Tags: cs2163, lab, git, racket
|
||||
|
||||
In this lab I learned about Racket recursion techniques.
|
||||
<!-- more -->
|
||||
## Rainbow example
|
||||
I had great difficulty in getting the rainbow code to work. I ended up with a working definition but not much time to do much else. My function follows:
|
||||
```racket
|
||||
(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)))]))
|
||||
(color-mapper p (list "red" "orange" "yellow" "green" "blue" "purple")))
|
||||
```
|
||||
This deines a function called rainbow 2, which then defines another function called color mapper. color mapper checks if there is an empty list, and if so, ends. If there is not an empty list, it calls the colorize function with the first item in the list, with the passed in graphical object. If then recursivly does this until the list is empty, since each recursive call removes an item from the start of the list. In the end you get a set of colored objects in the order of the function call at the end of the definition of rainbow 2.
|
||||
## Conclusion
|
||||
I did not do much of the lab as assigned, because of my difficulty in making the program. My understanding of how my program works after getting it working will help me in getting future labs done on time
|
@ -19,9 +19,9 @@
|
||||
<link rel="stylesheet" type="text/css" href="/css/custom.css">
|
||||
<!-- Feeds -->
|
||||
<link rel="alternate" type="application/atom+xml"
|
||||
href="/feeds/all.atom.xml" title="Atom Feed">
|
||||
href="/feeds\all.atom.xml" title="Atom Feed">
|
||||
<link rel="alternate" type="application/rss+xml"
|
||||
href="/feeds/all.rss.xml" title="RSS Feed">
|
||||
href="/feeds\all.rss.xml" title="RSS Feed">
|
||||
<!-- JS -->
|
||||
<script type="text/javascript">
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
@ -57,7 +57,7 @@
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="/tags/cs2163.html">cs2163</a><a class="dropdown-item" href="/tags/frog.html">frog</a><a class="dropdown-item" href="/tags/git.html">git</a><a class="dropdown-item" href="/tags/lab.html">lab</a><a class="dropdown-item" href="/tags/racket.html">racket</a>
|
||||
<a class="dropdown-item" href="/tags\cs2163.html">cs2163</a><a class="dropdown-item" href="/tags\frog.html">frog</a><a class="dropdown-item" href="/tags\git.html">git</a><a class="dropdown-item" href="/tags\lab.html">lab</a><a class="dropdown-item" href="/tags\racket.html">racket</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -66,11 +66,11 @@
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/feeds/all.atom.xml">Atom</a>
|
||||
<a class="nav-link" href="/feeds\all.atom.xml">Atom</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/feeds/all.rss.xml">RSS</a>
|
||||
<a class="nav-link" href="/feeds\all.rss.xml">RSS</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -91,28 +91,41 @@
|
||||
|
||||
<article>
|
||||
<header>
|
||||
<h2><a href='/2022/09/lab-one.html'>Lab One</a></h2>
|
||||
<h2><a href='/2022\09\lab-three.html'>Lab Three</a></h2>
|
||||
<p class='date-and-tags'>
|
||||
<time datetime="2022-09-12" pubdate="true">2022-09-12</time> - <span class="tags"><a href="/tags/cs2163.html">cs2163</a>, <a href="/tags/lab.html">lab</a>, <a href="/tags/frog.html">frog</a>, <a href="/tags/git.html">git</a></span></p>
|
||||
<time datetime="2022-09-14" pubdate="true">2022-09-14</time> - <span class="tags"><a href="/tags\cs2163.html">cs2163</a>, <a href="/tags\lab.html">lab</a>, <a href="/tags\git.html">git</a>, <a href="/tags\racket.html">racket</a></span></p>
|
||||
<p class='authors'>By: <span class="authors">Isaac Shoebottom</span></p>
|
||||
</header>
|
||||
|
||||
<p>In this lab we learned about how to use frog and git, and how to interact with the university git remote.</p>
|
||||
<p>In this lab I learned about Racket recursion techniques.</p>
|
||||
<footer>
|
||||
<a href='/2022/09/lab-one.html'>… more …</a>
|
||||
<a href='/2022\09\lab-three.html'>… more …</a>
|
||||
</footer>
|
||||
</article>
|
||||
<article>
|
||||
<header>
|
||||
<h2><a href='/2022/09/lab-two.html'>Lab Two</a></h2>
|
||||
<h2><a href='/2022\09\lab-two.html'>Lab Two</a></h2>
|
||||
<p class='date-and-tags'>
|
||||
<time datetime="2022-09-12" pubdate="true">2022-09-12</time> - <span class="tags"><a href="/tags/cs2163.html">cs2163</a>, <a href="/tags/lab.html">lab</a>, <a href="/tags/git.html">git</a>, <a href="/tags/racket.html">racket</a></span></p>
|
||||
<time datetime="2022-09-12" pubdate="true">2022-09-12</time> - <span class="tags"><a href="/tags\cs2163.html">cs2163</a>, <a href="/tags\lab.html">lab</a>, <a href="/tags\git.html">git</a>, <a href="/tags\racket.html">racket</a></span></p>
|
||||
<p class='authors'>By: <span class="authors">Isaac Shoebottom</span></p>
|
||||
</header>
|
||||
|
||||
<p>In this lab we learned more about git, and using racket to draw shapes</p>
|
||||
<footer>
|
||||
<a href='/2022/09/lab-two.html'>… more …</a>
|
||||
<a href='/2022\09\lab-two.html'>… more …</a>
|
||||
</footer>
|
||||
</article>
|
||||
<article>
|
||||
<header>
|
||||
<h2><a href='/2022\09\lab-one.html'>Lab One</a></h2>
|
||||
<p class='date-and-tags'>
|
||||
<time datetime="2022-09-07" pubdate="true">2022-09-07</time> - <span class="tags"><a href="/tags\cs2163.html">cs2163</a>, <a href="/tags\lab.html">lab</a>, <a href="/tags\frog.html">frog</a>, <a href="/tags\git.html">git</a></span></p>
|
||||
<p class='authors'>By: <span class="authors">Isaac Shoebottom</span></p>
|
||||
</header>
|
||||
|
||||
<p>In this lab we learned about how to use frog and git, and how to interact with the university git remote.</p>
|
||||
<footer>
|
||||
<a href='/2022\09\lab-one.html'>… more …</a>
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
|
@ -1,3 +1,4 @@
|
||||
http://www.example.com/2022/09/lab-one.html
|
||||
http://www.example.com/2022/09/lab-two.html
|
||||
http://www.example.com/2022\09\lab-three.html
|
||||
http://www.example.com/2022\09\lab-two.html
|
||||
http://www.example.com/2022\09\lab-one.html
|
||||
http://www.example.com/About.html
|
||||
|
30
labs/L03/first-rest-pattern.bak
Normal file
30
labs/L03/first-rest-pattern.bak
Normal file
@ -0,0 +1,30 @@
|
||||
#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")))
|
||||
|
||||
|
||||
(rainbow (circle 10))
|
||||
|
||||
;(define (rainbow2 color-list)
|
||||
; (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))
|
||||
; (color-mapper gr-obj (list "red" "orange" "yellow" "green" "blue" "purple"))]
|
||||
; )
|
||||
; )
|
||||
;)
|
||||
|
||||
|
||||
;[else (cons (colorize gr-obj (first color-list))
|
||||
; (color-mapper gr-obj (rest color-list)))]))
|
@ -12,12 +12,14 @@
|
||||
(list "red" "orange" "yellow" "green" "blue" "purple")))
|
||||
|
||||
|
||||
(rainbow (circle 10))
|
||||
|
||||
(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))]
|
||||
)
|
||||
[else (cons(colorize gr-obj (first color-list))
|
||||
(color-mapper gr-obj (rest color-list)))]))
|
||||
(color-mapper p (list "red" "orange" "yellow" "green" "blue" "purple")))
|
||||
|
||||
(rainbow2 (circle 20))
|
Loading…
Reference in New Issue
Block a user