Assignment 4Due: Wed 7 Dec. You may use one grace day on one of assignments 2, 3 and 4, handing one of them in up to 24 hours past the due time. You may work in pairs (and submit one version) for this assignment. Part I: 3D MathComplete Part II: 3D DrawingComplete Assignment 3You may use one grace day on one of assignments 2, 3 and 4, handing one of them in up to 24 hours past the due time. You may work in pairs (and submit one version) for this assignment. Part I: Maze Solving AlgorithmComplete Part II: Maze Input and OutputComplete Some mazes to try from CSC148. The intended start and end are labelled 1 and 2: a good exercise is to write a function to find a particular value in a grid. To read a file as a list of strings: (require 2htdp/batch-io) (read-lines «file-name-string») It can be fun calling (require 2htdp/universe) (run-movie «images-per-second» «list-of-images») Part III: 3D Maze Route AnimationLeft for Assignment 4. Assignment 2You may use one grace day on one of assignments 2, 3 and 4, handing one of them in up to 24 hours past the due time. You may work in pairs (and submit one version) for this assignment. There are two parts. Part I: Digital Sound ProcessingFollow these instructions. Part II: Web CrawlComplete this.. Assignment 1Write the functions described in the comments of this Racket file. Commentary, two solutions, and a review exercise for random-ae. Discussion of solution for value. One complete solution to A1 part I, but be sure to look at all three files. When we do structures soon, we'll cover and use pattern matching. You might enjoy trying and using it already, for lists. Some examples to get you started:
#lang racket
#| 'match' is a special form (not function). The syntax is: |#
#;
(match <exp>
[<pattern> <result-exp>]
...)
#| Semantics:
Evalute <exp>.
Match the value to first <pattern> whose form could create the value.
A <pattern> is built *syntactically* from:
literals
(new) variable names
constructor "calls" on patterns: (<constructor> <sub-pattern> ...)
It matches if the variables could be given values so that if the
<pattern> would be evaluated as an expression it would produce the
value of <exp>. |#
(match (+ 1 1) [2 "yes"])
(match (list 1 'a "b") [(list x y z) (list z y x)])
(match (list 1 'a "b") [(cons f r) (list f r)])
(match '((a) (bc) (d e) (f g))
[(cons (list a b) ps) b]
[(cons (list 'b) ps) ps]
[(cons (list b) ps) b])
|