Due Date

Due 11:59:59pm Wednesday, April 9


The goal of this assignment is to familiarize yourself with Scala. We have provided a basic tutorial on Scala to help this process along, which focuses specifically on points which are directly relevant to CS162. This tutorial is supplemented by the book "Programming Scala" by Dean Wampler, specifically chapters 1, 2, 3, 5, 6, and 8; this book is available online in the class website's page on Scala resources. It is recommended that you read these chapters along with doing the tutorial.

Download the template code and tutorial here. As a first step, you should go through this tutorial and fill in missing portions as needed to get code to run correctly. With the tutorial, you should start with introduction.html, then proceed through the scala files in order (starting with 0, then 1, etc.). Once you've completed the tutorial, there are three problems in SmallerProblems.scala which you must solve. Finally, you need to fill in the missing implementations in MyList.scala. More complete directions are contained in the aforementioned files.


A breakdown of the grade follows:

Do not let the low score of the tutorial fool you: it is expected that the tutorial will take a significant amount of time. Getting the remaining pieces to work without having gone through the tutorial would be extremely challenging, to say the least.

One other important note with grading: with the exception of vars we have introduced, you may not use any mutable state. That is, you cannot introduce new vars or any mutable data structures, only modify the few existing vars we have provided. This is to encourage you to think in a functional way, rather than to write Java/Python with a new syntax. This is expected to be difficult - you are learning to think in a way that you have probably never had to before, so it is somewhat like learning programming all over again.


You must turnin all files with the .scala extension. The command below should be sufficient:

turnin assign1@cs162 MyList.scala SmallerProblems.scala tutorial/*.scala