From 149f2f0218fb254b1ca64a9451ae085de8559e1d Mon Sep 17 00:00:00 2001 From: David Van Horn Date: Wed, 27 Mar 2019 10:44:42 -0400 Subject: [PATCH] Lab and assignment. --- 2/www/assign/5.scrbl | 9 +++------ 2/www/assignments.scrbl | 2 +- 2/www/lab/{15.scrbl => 14-old.scrbl} | 8 ++++---- 2/www/lab/{16.scrbl => 14.scrbl} | 20 ++++++++++++-------- 2/www/labs.scrbl | 2 +- 5 files changed, 21 insertions(+), 20 deletions(-) rename 2/www/lab/{15.scrbl => 14-old.scrbl} (92%) rename 2/www/lab/{16.scrbl => 14.scrbl} (89%) diff --git a/2/www/assign/5.scrbl b/2/www/assign/5.scrbl index 74bd1bb8..79a020b2 100644 --- a/2/www/assign/5.scrbl +++ b/2/www/assign/5.scrbl @@ -7,13 +7,10 @@ @assn-title[5]{Maps, Sets, MultiSets} -This is assignment is to be completed and submitted with your new -@link["https://piazza.com/class/jcspfhewmdn41y?cid=108"]{partner}. You -may not work with anyone other than your assigned partner. +This is assignment is to be completed and submitted individually. You +may not work with anyone else. -@bold{Due}: Tuesday, April 3, 11:59:59 PM EST. - -@(define @Piazza @link["http://piazza.com/umd/spring2018/cmsc132a"]{Piazza}) +@bold{Due}: Tuesday, April 2, 11:59:59 PM EST. @section[#:style 'unnumbered #:tag "assign5:download"]{Download the assignment project} diff --git a/2/www/assignments.scrbl b/2/www/assignments.scrbl index 713cfff0..c999e7d0 100644 --- a/2/www/assignments.scrbl +++ b/2/www/assignments.scrbl @@ -9,7 +9,7 @@ @include-section{assign/2.scrbl} @include-section{assign/3.scrbl} @include-section{assign/4.scrbl} -@;include-section{assign/5.scrbl} +@include-section{assign/5.scrbl} @;include-section{assign/6.scrbl} @;include-section{assign/7.scrbl} diff --git a/2/www/lab/15.scrbl b/2/www/lab/14-old.scrbl similarity index 92% rename from 2/www/lab/15.scrbl rename to 2/www/lab/14-old.scrbl index 3cc52ef2..ca5cf27b 100644 --- a/2/www/lab/15.scrbl +++ b/2/www/lab/14-old.scrbl @@ -2,9 +2,9 @@ @(require scribble/core (for-label lang/htdp-beginner 2htdp/universe) "helper.rkt") @(require "../utils.rkt") -@lab-title[15]{State in Worlds} +@lab-title[14]{State in Worlds} -@section[#:style 'unnumbered #:tag "lab15:intro"]{Intro} +@section[#:style 'unnumbered #:tag "lab14:intro"]{Intro} You'll work in this lab with your @link["https://piazza.com/class/jcspfhewmdn41y?cid=108"]{lab partners}. @@ -22,7 +22,7 @@ You can start this lab with @link["Lab15.zip"]{this project skeleton} or your own completed implementation of @labref{9}. -@section[#:style 'unnumbered #:tag "lab15:recall"]{Recall} +@section[#:style 'unnumbered #:tag "lab14:recall"]{Recall} In @labref{9} we made a simple game with a bouncy ball. @@ -39,7 +39,7 @@ not by creating new worlds from scratch but by @emph{mutating} the already present world. -@section[#:style 'unnumbered #:tag "lab15:impworld"]{Imperative Worlds} +@section[#:style 'unnumbered #:tag "lab14:impworld"]{Imperative Worlds} We've provided you a working copy of the bouncy ball game. Once you've opened the project skeleton (or made a copy of your own lab 9), import diff --git a/2/www/lab/16.scrbl b/2/www/lab/14.scrbl similarity index 89% rename from 2/www/lab/16.scrbl rename to 2/www/lab/14.scrbl index ded24871..e948b0dc 100644 --- a/2/www/lab/16.scrbl +++ b/2/www/lab/14.scrbl @@ -2,9 +2,9 @@ @(require scribble/core (for-label lang/htdp-beginner 2htdp/universe) "helper.rkt") @(require "../utils.rkt") -@lab-title[16]{Cyclic Lists} +@lab-title[14]{Cyclic Lists} -@section[#:style 'unnumbered #:tag "lab16:intro"]{Intro} +@section[#:style 'unnumbered #:tag "lab14:intro"]{Intro} You'll work in this lab with your @link["https://piazza.com/class/jcspfhewmdn41y?cid=108"]{lab partners}. @@ -24,7 +24,7 @@ skeleton}. In it you'll find an IntelliJ project with two Java files: during this lab. -@section[#:style 'unnumbered #:tag "lab16:recall"]{Recall} +@section[#:style 'unnumbered #:tag "lab14:recall"]{Recall} We've been learning about mutable and cyclic data structures in lecture. In this lab we're going to focus on writing operations on @@ -54,7 +54,7 @@ operations on lists that look like the following: }| -@section[#:style 'unnumbered #:tag "lab16:aside"]{First, A Note on Equality} +@section[#:style 'unnumbered #:tag "lab14:aside"]{First, A Note on Equality} Equality is a subtle subject in computer science. Most of you have probably noticed that Java includes two main equality operations: the @@ -62,7 +62,7 @@ probably noticed that Java includes two main equality operations: the you would expect or hope. @bold{Ex 1}: Do you expect this test to pass or fail? Uncomment this -test in @tt{Lab16.java} after you've talked it over with your partner. +test in @tt{Lab14.java} after you've talked it over with your partner. @verbatim|{ Integer one = 1; @@ -87,14 +87,14 @@ Knowing whether two objects are referentially equal can be useful, for example, when trying to identify a cycle in a list. -@section[#:style 'unnumbered #:tag "lab16:iscyclic"]{Identifying Cycles} +@section[#:style 'unnumbered #:tag "lab14:iscyclic"]{Identifying Cycles} The list implementation in @tt{Listof.java} implements a few operations that work fine on regular lists. However, these operations will loop forever if we try to apply them to cyclic lists. @bold{Ex 3}: Uncomment and run the four tests on the cyclic list in -@tt{Lab16.java} to confirm they loop forever. +@tt{Lab14.java} to confirm they loop forever. In @tt{Listof.java} you'll see the already implemented methods @tt{isCyclic} and @tt{isCyclicHelper}. @@ -129,7 +129,7 @@ cycle. In the @tt{Cons} case, the method @tt{isCyclic} passes head of the list again, we know we have a cyclic list. -@section[#:style 'unnumbered #:tag "lab16:ops"]{Operations on Cyclic Lists} +@section[#:style 'unnumbered #:tag "lab14:ops"]{Operations on Cyclic Lists} Each of these operations already work on non-cyclic lists. Extend them with a helper method that maintains a pointer to the head of the list @@ -146,3 +146,7 @@ ensure termination for cyclic lists. @bold{Ex 7}: Reimplement the methods @tt{length}, @tt{contains} using @tt{foldr} to ensure termination for cyclic lists. + +@section[#:style 'unnumbered #:tag "lab14:submit"]{Submission} + +Submit a zip file of your work at the end of lab. diff --git a/2/www/labs.scrbl b/2/www/labs.scrbl index 6f2eb645..661cb877 100644 --- a/2/www/labs.scrbl +++ b/2/www/labs.scrbl @@ -21,7 +21,7 @@ in lectures with helpful assistants around. @include-section{lab/11.scrbl} @include-section{lab/12.scrbl} @include-section{lab/13.scrbl} -@;include-section{lab/14.scrbl} +@include-section{lab/14.scrbl} @;include-section{lab/15.scrbl} @;include-section{lab/16.scrbl} @;include-section{lab/17.scrbl}