Skip to content

Commit

Permalink
Lab and assignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanhorn committed Mar 27, 2019
1 parent c0bb71f commit 149f2f0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
9 changes: 3 additions & 6 deletions 2/www/assign/5.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion 2/www/assignments.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
8 changes: 4 additions & 4 deletions 2/www/lab/15.scrbl → 2/www/lab/14-old.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -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.

Expand All @@ -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
Expand Down
20 changes: 12 additions & 8 deletions 2/www/lab/16.scrbl → 2/www/lab/14.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -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
Expand Down Expand Up @@ -54,15 +54,15 @@ 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
@tt{equals} method and the operator @tt{==}. These don't always act as
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;
Expand All @@ -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}.
Expand Down Expand Up @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion 2/www/labs.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 149f2f0

Please sign in to comment.