+
+
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..7041d29
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,41 @@
+name: publish-gh-pages
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ gh-pages:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Prepare _site
+ run: |
+ echo generate main html page in _site/
+ mkdir _site
+
+ - name: Generate main page
+ run: |
+ cp .assets/template.html _site/index.html
+ cp .assets/style.css _site/
+ npx marked@15.0.4 --gfm -i README.md >> _site/index.html
+ cat .assets/template_end.html >> _site/index.html
+ mkdir _site/assignments
+ cp learninggoals.html _site/
+
+ - name: Push to gh-pages
+ run: |
+ git clone --quiet --branch gh-pages --depth 1 https://github.com/${{ github.repository }}.git .gh-pages
+ rm -rf .gh-pages/*
+ mv _site/* .gh-pages
+ cd .gh-pages
+ git add .
+ touch .nojekyll
+ git add .nojekyll
+ git config --local user.email "jlacomis@cmu.edu"
+ git config --local user.name "GitHub Action"
+ git commit --allow-empty -m "Update gh-pages for ${{ github.sha }}"
+ git push https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:gh-pages --force --follow-tags -v
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dd05154
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.aux
+*.fdb_latexmk
+*.fls
+*.log
+
diff --git a/.markdownlint.json b/.markdownlint.json
new file mode 100644
index 0000000..2ec9c5f
--- /dev/null
+++ b/.markdownlint.json
@@ -0,0 +1,4 @@
+{
+ "MD033": false,
+ "MD013": false
+}
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c275d48
--- /dev/null
+++ b/README.md
@@ -0,0 +1,537 @@
+# Principles of Software Construction Objects, Design, and Concurrency
+
+## Overview
+
+Software engineers today are less likely to design data structures and algorithms from scratch and more likely to build systems from library and framework components. In this course, students engage with concepts related to the construction of software systems at scale, building on their understanding of the basic building blocks of data structures, algorithms, program structures, and computer structures. The course covers technical topics in four areas: (1) concepts of design for complex systems, (2) object oriented programming, (3) static and dynamic analysis for programs, and (4) concurrent and distributed software. Student assignments involve engagement with complex software such as distributed massively multi-player game systems and frameworks for graphical user interaction.
+
+After completing this course, students will:
+
+- Be comfortable with object-oriented concepts and with programming in the Java or JavaScript language
+- Have experience designing medium-scale systems with patterns
+- Have experience testing and analyzing your software
+- Understand principles of concurrency and distributed systems
+
+See a more detailed list of [learning goals](https://cmu-17-214.github.io/s2025/learninggoals.html) describing what we want students to know or be able to do by the end of the semester. We evaluate whether learning goals have been achieved through assignments and exams.
+
+### Coordinates
+
+M/W 11:00 - 12:20 p.m. in [Scaife Hall (SH)](https://www.cmu.edu/admission/sites/default/files/inline-files/Carnegie%20Mellon%20University%20Campus%20Map.pdf) 105
+
+**[Hammad Ahmad](https://hammadahmad.io/)**, [TCS](https://www.cmu.edu/admission/sites/default/files/inline-files/Carnegie%20Mellon%20University%20Campus%20Map.pdf) 341, office hours: see calendar
+
+**[Jeremy Lacomis](https://jeremylacomis.com/)**, [TCS](https://www.cmu.edu/admission/sites/default/files/inline-files/Carnegie%20Mellon%20University%20Campus%20Map.pdf) 362, office hours: see calendar
+
+Our TAs also provide additional office hours each week; see details in the calendar.
+
+The instructors have an open door policy: If the instructors' office doors are open and no-one else is meeting with us, we are happy to answer any course-related questions. Feel free to email us for appointments; we are also available over Zoom.
+
+## Calendar
+
+
+
+## Schedule
+
+The schedule below reflects our current plans, but will be updated throughout the semester.
+
+
+## Staff
+
+Instructors: [Hammad Ahmad](https://hammadahmad.io/) [hammada] and [Jeremy Lacomis](https://jeremylacomis.com/) [jlacomis]
+
+TAs:
+Connie (Wenjun) Zhou [wenjunz2],
+
+Terry (Jielin) Li [jielinl],
+
+Yikang Cheng [yikangc],
+
+Eileen Gu [yingfan2],
+
+Yibo Ma [yibom]
+
+
+
+## Course Syllabus and Policies
+
+### Prerequisites
+
+- 15-122 or 15-211, or equivalent with instructor's permission
+- The equivalent of 2 semester-long programming classes
+ - Ability to write small programs in C (or Java, C#, or other imperative languages with pointers or references)
+ - Ability to reason about programs using preconditions, postconditions, and invariants
+ - Familiarity with a basic set of algorithms and data structures (linked lists, simple graph and sorting algorithms)
+
+- 15-151 or 21-127, or equivalent with instructor's permission
+ - Sound foundation of mathematical concepts; ability to reason formally
+
+------
+
+### Grading and Deadlines
+
+Evaluation will be based on the following percentages:
+
+- 50% assignments (1000 total points, each assignment has a different weighting)
+- 30% exams (7.5% for each of 2 midterm exams and 15% for the final)
+- 10% labs
+- 10% participation and quizzes
+
+This course does not have a fixed letter grade policy; i.e., the final letter grades will **not** be A=90-100%, B=80-90%, etc.
+
+**Homework grading and regrading.** We try to be transparent in our rubrics in our assignments. Feel free to ask instructors or TAs clarification questions about the rubrics before the assignment is due. If you disagree with a grade, please submit a regrade request within 7 days on Gradescope. Regrade requests need a justification, explaining why our assessment is inconsistent with the rubric. Regrade requests without such justification will be closed.
+
+Each student can *resubmit* any *one* assignment milestone and it will be regraded as if it was the first submission (see below).
+
+**Participation and quizzes.** You should expect a quiz at the start of nearly every lecture and often additional in-class activities within the lecture. When a reading assignment is given, the quiz will typically touch on the content from the reading material. Otherwise (and sometimes in addition), the quiz centers around the content from the most recent lecture or two. A quiz will typically have 1-2 questions and is graded pass/fail.
+
+**Labs.** Labs will be graded on a pass/fail basis during recitations. You will have a chance during recitation to improve your solution. See a description [here](https://github.com/CMU-17-214/f2024/blob/main/labs.md).
+
+**Late work.** We understand that normal life events, including projects and exams in other courses and technical difficulties out of your control, can interfere with your ability to complete your work on time or attend lectures and recitations. Our philosophy is that our late work policy includes built-in flexibility but that the policy will be uniformly applied to all students in all circumstances. Exceptions to this policy will be made only with explicit accommodations, almost always involving a family or medical emergency with your academic advisor or the Dean of Student Affairs requesting the exception on your behalf.
+
+We provide the following flexibility, no questions asked, no justification needed:
+
+- For quizzes, we will drop up to two missed/failed solutions during the semester.
+- For labs, we will drop up to two missed/failed solutions during the semester.
+- For homework deadlines you have 5 free late days for the semester. You can exceed each deadline by up to three days (unless explicitly specified otherwise in the assignment, check carefully), for a penalty of 10% per day once you run out of free late days. This policy applies to all homework deadlines *except homeworks 2a and 2b*.
+- For a single homework deadline during the semester, you can redo and resubmit your work after it was graded. It will be regraded as if it was the first submission and you can regain all lost points. Each student can only do this once. We accept resubmissions until December 8th at 11:59pm. (While we do not recommend it, you can use this as arbitrary late days for a single deadline, receiving 0 points for missing the initial deadline and then resubmitting later).
+
+Any work submitted beyond the flexibility provided by these mechanisms will receive feedback but no credit unless explicit accommodations were provided.
+
+------
+
+### Attendance and remote participation
+
+This course, including recitations, is marked by the registrar as IPE ("delivered in-person, students are expected to be in the classroom during the course's scheduled meeting time"). We do not plan to make accommodations for remote attendance.
+
+We strongly recommend attending lectures. We have regular in-class activities and quizzes that we expect you to complete in class. Attending recitations is required for grading labs.
+
+In case of illness, quarantine, or other exceptional circumstances, we may be able to share recordings of lectures upon request on a case by case basis. Recordings may not be shared to protect the FERPA rights of all students in the classroom.
+
+------
+
+### Textbooks
+
+This course will occasionally assign **mandatory readings**, from the two text books below. The CMU library has both physical and electronic copies of these books. You can access *all* of these books for free electronically through the CMU library.
+
+- Larman, Craig. [*Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development*](https://bookshop.org/books/applying-uml-and-patterns-an-introduction-to-object-oriented-analysis-and-design-and-iterative-development/9780131489066), 3rd Edition. Prentice Hall. ISBN 0-13-148906-2. [[CMU Library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/6lpsnm/alma991019576227704436)] This book describes basics of object-oriented design, responsibility assignment, and some design patterns used in the course. We will use the third edition, which covers the course's topics in more details than earlier editions. We will assign select chapters.
+- Bloch, Joshua. [*Effective Java*](https://bookshop.org/books/effective-java-9780134685991/9780134685991), Third Edition. Addison-Wesley, ISBN 978-0-13-468599-1. [[CMU Library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/1feg4j8/alma991019578256404436)] This book covers many aspects of program design, not only those specific to Java. We will assign multiple chapters.
+
+In addition, we list **several optional readings** that may be helpful with specific topics in the course. Especially if Java/Javascript is new to you, you might want to consider exploring additional books.
+
+- Object-Oriented Design and Design Patterns
+ - Alan Shalloway and James Trott. [*Design Patterns Explained: A New Perspective on Object-Oriented Design (2nd Ed.)*](https://bookshop.org/books/design-patterns-explained-a-new-perspective-on-object-oriented-design/9780321247148) [[CMU Library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/1feg4j8/alma991019576375404436)]
+ - Gamma et al. [*Design Patterns: Elements of Reusable Object-Oriented Software*](https://bookshop.org/books/design-patterns-elements-of-reusable-object-oriented-software/9780201633610). Addison Wesley. ISBN 0-201-63361-2 [[CMU Library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/6lpsnm/alma991019576613104436)] (this is an excellent book, but more of a reference text than the *Design Patterns Explained* book. In addition, because it was the original patterns book, the examples are in C++ and Smalltalk, not Java)
+
+- Java
+ - *Note: Here are some popular textbook and online resources for learning Java.*
+ - Sestoft. [*Java Precisely*](https://bookshop.org/books/java-precisely-third-edition/9780262529075). MIT Press, 2016. [[2nd edition in the CMU library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/1feg4j8/alma991016506989704436)] (this is a very concise reference with many good examples; it assumes that you already know other programming languages)
+ - [Introduction to Programming Using Java](http://math.hws.edu/javanotes/) (free online textbook)
+ - [Blue Pelican Java](http://www.bluepelicanjava.com/) (free online textbook)
+
+- Javascript/Typescript
+ - Douglas Crockford. [JavaScript: The good parts](https://bookshop.org/books/javascript-the-good-parts-the-good-parts/9780596517748). O'Reilly, 2008. [[CMU library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/6lpsnm/alma991019576570404436)]
+ - Boris Cherny. [Programming Typescript: Making Your JavaScript Applications Scale](https://bookshop.org/books/programming-typescript-making-your-javascript-applications-scale/9781492037651). O'Reilly, 2019. [[CMU library](https://cmu.primo.exlibrisgroup.com/permalink/01CMU_INST/6lpsnm/alma991019642791104436)]
+
+------
+
+### Time management
+
+This is a 12-unit course, and it is our intention to manage it so that you spend close to 12 hours a week on the course, on average. In general, 4 hours/week will be spent in class, 1 hour on labs, and 7 hours on assignments. Please feel free to give the course staff feedback on how much time the course is taking for you.
+
+------
+
+### Research to Improve the Course
+
+
+For this class, we are conducting research on teaching and learning. This research will involve some student work. You will not be asked to do anything above and beyond the normal learning activities and assignments that are part of this course. You are free not to participate in this research, and your participation will have no influence on your grade for this course or your academic career at CMU. If you do not wish to participate, please send an email to Chad Hershock (). Participants will not receive any compensation. The data collected as part of this research will include student grades. All analyses of data from participants’ coursework will be conducted after the course is over and final grades are submitted. The Eberly Center may provide support on this research project regarding data analysis and interpretation. The Eberly Center for Teaching Excellence & Educational Innovation is located on the CMU-Pittsburgh Campus and its mission is to support the professional development of all CMU instructors regarding teaching and learning. To minimize the risk of breach of confidentiality, the Eberly Center will never have access to data from this course containing your personal identifiers. All data will be analyzed in de-identified form and presented in the aggregate, without any personal identifiers. If you have questions pertaining to your rights as a research participant, or to report concerns to this study, please contact Chad Hershock ().
+
+------
+
+### Collaboration policy and academic integrity
+
+The usual policies apply, especially the University Policy on Academic Integrity. We expect that your work on assignments, projects, and exams will be your own work. The key guiding principle of academic honesty in this course is: *"You may not copy any part of a solution to a problem that was written by another student (in this or prior iterations of the class), or was developed together with another student, or was delegated to another person. You may not look at another student's solution, even if you have completed your own, nor may you knowingly give your solution to another student or leave your solution where another student can see it."* Note that this implies that you cannot publicly post your solutions on GitHub (e.g., as part of a portfolio during job applications). We also expect and respect honesty when communicating with the course staff.
+
+Any violation of this policy is cheating. We use automated systems to detect software plagiarism. These automated systems are highly effective and, so far, have detected software plagiarism almost every semester. The minimum penalty for cheating will be a zero grade for the whole assignment. Cheating incidents will also be reported through University channels, with possible additional disciplinary action (see the University Policy on Academic Integrity).
+
+For labs and homeworks you are allowed to use various tools and help available to professional programmers, such as online documentation, online tutorials and support forums like Stackoverflow, and AI assistants like Copilot and ChatGPT. You are allowed to post technical questions about aspects of the homework elsewhere, as long as you do not ask other humans to complete the work for you. Whenever you use external resources like this, you are still fully responsible for the correctness of your solution and complying with licenses. Note that content generation tools often create plausible-looking but incorrect answers, which will not receive credit.
+
+When you use AI assistants in homework, some assignments may require you to briefly describe their use and your experience with the homework submission.
+
+Here are some examples of behavior that are inappropriate:
+
+- Copying (or retyping) files, parts of files (such as source code, written text, or unit tests), quiz solutions, or exam solutions from another person or source, either in draft or final form, even if the file permissions are incorrectly set to allow it. This behavior is still clearly inappropriate even if you make modifications (such as style changes or minor logic modifications) from the original source.
+- Searching for or viewing a current or past student's homework solution.
+- Allowing someone else to view or copy your code, written assignment, quiz, or exam, either in draft or final form.
+- Writing, using, or submitting a program that attempts to alter or erase grading information or otherwise compromise security of course resources.
+- Lying to course staff.
+- Making your work publicly available in a way that other students (current or future) can access your solutions, even if others’ access is accidental or incidental to your goals.
+
+Here are some examples of acceptable behaviors:
+
+- Solve technical problems by searching for the error message with Google or on StackOverflow.
+- Copying code snippets from tutorials or StackOverflow into your own code.
+- Importing libraries as part of your implementation. Reading documentation and examples of libraries. Copying libraries or utility files into your repository (bad practice to avoid, but not consider cheating).
+- Copying code from labs or reference solutions provided in recitations.
+- Using GitHub Copilot while writing your solution.
+- Using ChatGPT to write or help write justifications in homework assignments, while checking the correctness of the answer.
+- Looking at other students' solutions when explicitly instructed by the course staff, for example, as part of peer grading for labs, quizzes, or homework.
+
+There is no statute of limitations for violations of the collaboration policy; penalties may be assessed (and referred to the university disciplinary board) after you have completed the course, and some requirements of the collaboration policy (such as restrictions on you posting your solutions) extend beyond your completion of the course.
+
+If you have any question about how this policy applies in a particular situation, ask the instructors or TAs for clarification.
+
+------
+
+### Audit Policy
+
+If you desire to audit the course, our general requirement is that you complete homeworks to achieve at least 50% of the total homework grade. Solutions do not need to be fully complete, but we encourage you to attempt to do so. We additionally encourage you to attend lectures and complete labs, but you are not required to do so. You should not attend our midterm exams or final exam.
+
+------
+
+### Your health matters
+
+When we say "your health matters" we mean exactly that: Your health matters. We don't intend to imply that other peoples' health does not matter, or that your health matters more or less than theirs. We know that CMU can be a stressful, risky environment, and *your* health is the health that is relevant in this conversation. Worries about Covid-19 and possible remote classes do not help.
+
+**Please take care of yourself**. Do your best to maintain a healthy lifestyle this semester by eating well, exercising, avoiding drugs and alcohol, getting enough sleep and taking some time to relax. This will help you achieve your goals and cope with stress.
+
+All of us benefit from support during times of struggle. You are not alone. There are many helpful resources available on campus and an important part of the college experience is learning how to ask for help. Asking for support sooner rather than later is often helpful.
+
+If you or anyone you know experiences any academic stress, difficult life events, or feelings like anxiety or depression, we strongly encourage you to seek support. Counseling and Psychological Services (CaPS) is here to help: call 412-268-2922 and visit their website at . Consider reaching out to a friend, faculty or family member you trust for help getting connected to the support that can help.
+
+If you are worried about affording food or feeling insecure about food, there are resources on campus who can help. Email the CMU Food Pantry Coordinator to schedule an appointment:
+
+**Respect for diversity.** It is our intent that students from all diverse backgrounds and perspectives be well served by this course, that students’ learning needs be addressed both in and out of class, and that the diversity that students bring to this class be viewed as a resource, strength and benefit. It is my intent to present materials and activities that are respectful of diversity: gender, sexuality, disability, age, socioeconomic status, ethnicity, race, and culture. Your suggestions are encouraged and appreciated. Please let us know ways to improve the effectiveness of the course for you personally or for other students or student groups.
+
+**Accommodations for students with disabilities.** If you have a disability and have an accommodations letter from the Disability Resources office, we encourage you to discuss your accommodations and needs with us as early in the semester as possible. We will work with you to ensure that accommodations are provided as appropriate. If you suspect that you may have a disability and would benefit from accommodations but are not yet registered with the Office of Disability Resources, we encourage you to contact them at .
+
+------
+
+### Informal feedback on this course
+
+We are planning many changes to this course in this semester and not everything will work out smoothly the first time. We’d like you to provide ongoing feedback on your experience in the course, so that we can take into account your experience and adapt our practices to make the course work for you.
+
+Outside of the regular course meetings and Piazza, you can submit feedback about anything in the course per email to the instructors or ask TAs to forward them anonymously. We will read every message submitted and use your feedback to try to improve the way we are teaching.
diff --git a/examples/lect02simulation.zip b/examples/lect02simulation.zip
new file mode 100644
index 0000000..dcb728a
Binary files /dev/null and b/examples/lect02simulation.zip differ
diff --git a/labs.md b/labs.md
new file mode 100644
index 0000000..33a98c3
--- /dev/null
+++ b/labs.md
@@ -0,0 +1,18 @@
+# Labs
+
+This semester, we have weekly labs. Labs introduce exercises to apply concepts from lectures to concrete problems and they often provide concrete suggestions for tooling and notation.
+
+We release lab assignments several days before the lab sessions on Mondays. Lab assignments are typically intended to take less than one hour of work per week, but they can take longer if you face technical difficulties or struggle with lecture concepts. You should attempt the lab assignment before the lab session, but if you have questions or face problems you can attend the lab session with incomplete work and continue working on it with the help of TAs during the lab session.[^1] Note that you are unlikely to have enough time to complete the work during the lab session if you do not start before the lab session.
+
+Each lab assignment has one or more concrete deliverables, each worth one point. You get points for labs by showing your work to a TA during the weekly lab session. Typically showing your work involves showing source code, demoing executions, and (verbally) answering a few questions.[^2] We intend labs to be very low stakes – this is your first practical engagement with the material and mistakes are a normal part of the learning process. Deliverables are graded pass/fail on whether they meet the stated requirements. If your solution does not meet the requirements you can continue working on it during the lab session until it does.
+
+At the end of the lab session, we will discuss possible solutions.
+
+## Collaboration policy
+
+In contrast to homework assignments, we have a very relaxed collaboration policy for labs. You can work together with other students both before the lab session and during the lab session. While we do not recommend it, you may look at other students’ solutions and reference solutions and even copy them. However, you will have to present and explain your solution to the TA on your own.
+
+
+
+[^1]: If it takes you more than one hour to complete the lab assignment, we recommend to stop and take your incomplete solution to the lab session where TAs can help you to complete the work.
+[^2]: The TA may ask a few questions about your implementation to probe that you understand your work. If deliverables do not require coding or drawing but instead ask to answer a question (e.g., what best practices are violated in a piece of code) we expect that you give the answer verbally to the TA (you are welcome to type out notes to prepare the answer if you like).
diff --git a/learninggoals.html b/learninggoals.html
new file mode 100644
index 0000000..1b1a0da
--- /dev/null
+++ b/learninggoals.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+ 17-214: Principles of Software System Construction
+
+
+
+
+
+
+
+
+
+
Principles of Software Construction Objects, Design, and Concurrency
Use modern development tools to design and implement nontrivial programs
+
+
Write programs of medium complexity
+
Use standard tools expected of professional developers: IDEs, refactoring, debugging, version control, static analysis, code review
+
Write simple user interfaces using command line or visual frontends
+
+
+
Design code that is easy to understand, maintain, and reuse
+
+
Domain modeling, responsibility assignment
+
Taming complexity: Patterns, types, abstraction, and reducing coupling
+
Design for change: Information hiding, contracts, subtype polymorphism
+
Design for reuse: Small scale: Delegation, inheritance, parametric polymorphism (generics)
+Immutable data structures
+
Structuring systems at different scale: methods, classes, modules, subsystems (microservices)
+
Understand and apply common design patterns (technically belongs to the previous point)
+
+
Understand the idea behind design patterns
+
Evaluate when to use design patterns and apply them to solve common design problems
+
Understand common anti-patterns
+
+
+
+
+
Use and design libraries, frameworks, and APIs (design for reuse at scale)
+
Program confidently with concurrency
+
+
Challenges and modern solutions and patterns
+
Basic understanding of distributed systems and RPC, client server, microservice
+
+
+
Assess functional correctness with unit tests
+
+
Competency in writing unit tests and integration tests
+
Create tests using a dedicated testing strategy (boundary condition, coverage, …)
+
Design software to be testable, good test suite design
+
Build and test automation, CI, test coverage
+
Testing robustness, integration testing
+
Ideas in unit testing: TDD, BDD, …
+
Understand the tradeoffs between formal verification and testing (and type checking and static analysis)
+
+
+
+
+
+
+
+
+
diff --git a/previous-assignments/hw1.md b/previous-assignments/hw1.md
new file mode 100644
index 0000000..e036230
--- /dev/null
+++ b/previous-assignments/hw1.md
@@ -0,0 +1,100 @@
+# Homework 1: Warm-Up with Flash Cards
+
+In this assignment, you will complete a simple [flashcard](https://en.wikipedia.org/wiki/Flashcard) learning system. For now, we are keeping things simple and use an interactive command-line interface, one of the simplest and oldest user interfaces for computer programs. The goals of this assignment are to familiarize you with our course infrastructure, let you practice object-oriented programming in Java and TypeScript, and start using public libraries. While you will only write very little code for this assignment, you may spend significant time getting familiar with the languages, infrastructure, and tooling.
+
+## Provided Implementation
+
+Like often common in software engineering practice, you won't start entirely from scratch but start with an existing implementation. Fortunately, it's even somewhat documented and clean, so you should be able to figure out what's happening by reading documentation and code. You may change existing code if you like.
+
+With the GitHub classroom link on Canvas create a Git repository with the provided starter code. The repository has one directory for Java and one directory for TypeScript. You will complete the tasks for this homework once **in each language**. Each directory has its own README with language specific information. Note that the Java implementation has a folder named achievement that implements an achievement system for the flashcard learning system. This folder only becomes relevant in Homework 2 which builds on this assignment. You will not need to make any changes to it in this homework.
+
+You should use an IDE to load and edit the projects. We recommend (and will only provide support for) [VSCode](https://code.visualstudio.com/) for both Java and TypeScript development, but you are welcome to use [IntelliJ](https://www.jetbrains.com/idea/) or other IDEs if you prefer (note you can get free access to Enterprise IntelliJ via an Education discount, which will also give you access to TypeScript support).
+
+## Tasks
+
+**Task 1: Implement new card organizer.** Implement a new card organizer **RecentMistakesFirstSorter** by creating objects that implement the `CardOrganizer` interface. The organizer should work as follows: *"Orders the cards so that those that were answered incorrectly in the last round appear first. This reordering should be stable: it does not change the relative order of any pair of cards that were both answered correctly or incorrectly. So, if no cards were answered incorrectly in the last round, this does not change the cards' ordering."*
+
+Starting points: try to dissect the specification into its main components. What should the behavior be under "typical" inputs (e.g., one card with a recent failure, one without; cards with several successes and failures), and what scenarios does it outline as exceptions? Do avoid implementing anything extra that is not part of the specification.
+
+We recommend to name your new sorter `RecentMistakesFirstSorter` in Java and `newRecentMistakesFirstSorter` in TypeScript. Your sorter should implement the *CardOrganizer* interface.
+
+Note that only a relatively small amount of code is necessary to implement this new class, regardless of language. Only minimal changes will be required outside of your new class, in particular to test the new sorter by using it in place of the sorter the code starts with (`CardShuffler`/`newCardShuffler`).
+
+**Task 2: Command-line interface.** There is already some implementation of a textual user interface that prints questions and reads answers. But, the codebase implements a number of different card ordering and filtering mechanisms; the UI does not take advantage of them. It also does not read in a filename for the card file; this is hard-coded. This is not very user friendly.
+
+Your task is to develop a proper command-line interface that parses provided arguments and sets up the right card deck and the organizing mechanisms. Parsing command-line options is a standard task that has been done many times before, no there is need to start entirely from scratch! Instead, you should find and use an **open-source library** for command-line options and use it to provide an interface comparable to this:
+
+```bash
+flashcard [options]
+
+Options:
+ --help Show this help
+ --order The type of ordering to use, default "random"
+ [choices: "random", "worst-first", "recent-mistakes-first"]
+ --repetitions The number of times to each card should be answered
+ successfully. If not provided, every card is presented once,
+ regardless of the correctness of the answer.
+ --invertCards If set, it flips answer and question for each card. That is,
+ it prompts with the card's answer and asks the user to
+ provide the corresponding question.
+ Default: false
+
+```
+
+(The program does not need to be runnable using the `flashcard` keyword as above; we just used that to illustrate concisely.)
+
+Your code should provide these options and check that valid values are provided, reporting errors (and exiting) otherwise. When your program is started, parse these parameters with your library and then start the user interface with suitable parameters. For example, the program should read the cards from the file provided as command line argument and should flip the cards when `--invertCards` is provided. You should make your *RecentMistakesFirstSorter* from Task 1 available through this command line interface (this corresponds to the `"recent-mistakes-first"` option).
+
+If the program is called with the `--help` option, it should display a message similar to the one above and exit the program. It **does not** have to be exactly the same as the one we provide, but you should strive for something similar. A line at the top showing the usage of the command and listing all of the options with what they do is sufficient. You should look at the documentation for the library you choose to use as many provide functionality that helps you achieve this.
+
+Any combination of the options should be able to be applied at the same time; however, passing the `--help` flag with any other options should just display the help message and exit. Again, the library you use may provide you with a way to implement this functionality.
+
+**All** of these options can be configured using the existing codebase, meaning you **do not need** to add any new functionality to the program. Rather, the only changes you need to make are to the program's dependencies and to its entry point, so that it functions as a command-line interface described above. All of your code for this task will therefore most likely be within `index.ts` and `Main.java`.
+
+You are free to use any open source library on *Maven Central* or *npm* for this project. There are many many choices with different levels of quality and documentation (e.g., [Apache Commons CLI](https://commons.apache.org/proper/commons-cli/), [jopt](https://github.com/jopt-simple/jopt-simple) [JArgs](http://jargs.sourceforge.net/), [yargs](https://yargs.js.org/), [args](https://www.npmjs.com/package/args), [commander](https://www.npmjs.com/package/commander)), explore them and pick one. Note, support and ease of use may be an important factor in choosing a library -- explore alternatives if a library is confusing, too complex, poorly documented, or uses language features you do not understand.
+
+**Infrastructure and quality requirements.**
+
+* Push all your code to GitHub using good practices (e.g., cohesive commits, descriptive commit messages).
+* Your code should compile and pass automated checks when executed with the build tool (`mvn site` or `npm build`). Your code should automatically be executed on [GitHub Actions](https://github.com/features/actions), a continuous integration service. Your build should succeed on GitHub Actions, however, GitHub Actions is not configured as an auto-grader for this assignment and does not perform any tests. Passing GitHub Actions is just a minimum bar, not a sufficient condition for completing the homework. You can find the results of the automated checks in the *Actions* tab of your GitHub repository.
+* Follow good design practices as discussed: Hide information where appropriate. Program against interfaces, not against classes.
+* For all new code that you write, follow the style guidelines of the language you are working in ([Java code conventions](https://www.oracle.com/java/technologies/javase/codeconventions-introduction.html), [StandardJS guidelines](https://standardjs.com/)). We have installed tools (CheckStyle and ESlint) that will automatically check conformance to many style guidelines in your repository.
+* If you add libraries, add them as *maven* or *npm* dependencies. Do *not* copy library code into the repository.
+
+**Hints.** The first labs cover some basics and best practices of working with Git and provides guidance on how to set up your development environment. The second lecture covers basic design principles for object-oriented design, especially encapsulation. The subsequent readings provides pointers to relevant language concepts, but you will probably need to engage with language documentation beyond the presented basic concepts yourself (for example, the provided code uses recent Java features and ES6 features).
+
+Descriptive commit messages are those where an experienced developer would be able infer what the scope of your changes is from just reading the commit message. Your commit messages do not necessarily need to explicity refer to files changed. They should describe the changes your commit will make in an imperative present tense sentence. Here are a few examples of descriptive commit messages: "Implement recent mistakes first sorter", "Fix CLI incorrectly handling repetitions", "Add documentation for recent mistakes first sorter". Avoid commit messages like "Finish Java" or "Add comments" as they don't have enough detail for someone to understand what exactly is being changed.
+
+In order to keep runtime minimum for the automated checks, all GitHub Action checks are run with a timeout of 2 minutes, which should be plenty of time to run the checks for this assignment. If you do run into an issue where your build fails and you think it was an internal GitHub issue with running the automated checks, you can manually rerun that test. If you go to the *Actions* tab of your GitHub repository and click the failed build, at the top right you should see a button that says *Re-run all jobs*. Clicking that will rerun the test. If you still get a timeout issue even after this, try waiting a bit (maybe 15 minutes or so) then rerun again, or come to office hours.
+
+## Submitting your work
+
+Always push all code to GitHub. Once you have pushed your final code there and are done with the assignment, you should submit a link to your final commit on Canvas. A link will look like `https://github.com/CMU-17-214-Students//commit/`. You can get to this link easily when you click on the last commit (above the list of files) in the GitHub web interface. Paste this link into the text box on the assignment submission page located on Canvas and click submit.
+
+## Evaluation
+
+The assignment is worth 150 points. We will grade the assignment with this rubric:
+
+**New card organizer (50pt):**
+
+* [ ] 20: The solution implements the above specification correctly and nothing more for both languages (partial credit 15pt for one language)
+* [ ] 5: The TypeScript implementation is reasonably well documented, using the API documentation style of the language.
+* [ ] 5: The Java implementation is reasonably well documented, using the API documentation style of the language.
+* [ ] 20: The implementation in both languages is well organized and does not expose unnecessary implementation details (encapsulation) and it programs against interfaces, not classes. (partial credit 15pt for one language)
+
+**Command-line processing (55pt):**
+
+* [ ] 15: The implementation in both languages makes use of an external library, imported through a package manager (partial credit 10pt for one language)
+* [ ] 20: The implementation in both languages parses and validates target files for card decks and all 4 options listed above. It rejects invalid options or arguments with an error message. Examples of invalid options or arguments include negative numbers for repetitions and organizers that don't exist or contain numbers. (partial credit 15pt for one language)
+* [ ] 20: The implementation in both languages responds correctly to the command-line options -- opens the right card deck, uses the right organization strategies, lists help, etc. (partial credit 15pt for one language)
+
+**Infrastructure and style (45pt):**
+
+* [ ] 10: The URL submitted to Canvas is in the specified format and links to a specific commit.
+* [ ] 5: The TypeScript build is executed and passes on GitHub Actions.
+* [ ] 5: The Java build is executed and passes on GitHub Actions.
+* [ ] 5: Most commits are reasonably cohesive
+* [ ] 5: Most commit messages are reasonably descriptive
+* [ ] 5: The TypeScript code generally follows the common TypeScript style guidelines (e.g., as checked by ts-standard)
+* [ ] 5: The Java code generally follows the Java style guidelines (e.g., as checked by CheckStyle)
+* [ ] 5: The implementation in both languages is clean and concise. It does not introduce unnecessary variables or dead or out-commented code.
diff --git a/previous-assignments/hw2.md b/previous-assignments/hw2.md
new file mode 100644
index 0000000..f900a80
--- /dev/null
+++ b/previous-assignments/hw2.md
@@ -0,0 +1,185 @@
+# Homework 2: Santorini (Part 1)
+
+In this assignment, you will design and implement the core logic of a board game called Santorini (2 players, without god cards) in Java and you will review other designs for this game. The focus of this assignment is on considering design alternatives for code. This assignment is intended as a gentle introduction to modeling on a relatively simple problem. It is intended to be low stakes and you will have opportunities to receive feedback and learn from mistakes. In Homework 6, we will revisit the game and extend it with god cards and with a GUI.
+
+**This homework has 3 milestones:**
+
+* Milestone 2a: You will design and implement the core of Santorini.
+* Milestone 2b: You will critique other designs and implementations of Santorini.
+* Milestone 2c: You have an opportunity to revise your design and implementation based on our and other students' feedback.
+
+Milestone 2a and 2c are evaluated with the same criteria. Milestone 2a will be graded but will not count toward your final grade; instead we will regrade your design in Milestone 2c.
+
+This assignment has the following learning goals:
+
+* Demonstrate a comprehensive design and development process including object-oriented analysis, object-oriented design, and implementation.
+
+* Demonstrate the use of design goals to influence your design choices, assigning responsibilities carefully, using design patterns where appropriate, discussing trade-offs among alternative designs, and choosing an appropriate solution. The core logic of your solution must be testable and completely independent from your solution’s eventual graphical user interface (GUI).
+
+* Communicate design ideas clearly, including design documents that demonstrate fluency with the basic notation of UML class diagrams and interaction diagrams, the correct use of design vocabulary, and an appropriate level of formality in the specification of system behavior.
+
+To start the assignment, use the GitHub classroom link from the Canvas assignment to create your personal repository. It will only contain a template for one design document -- you will check in both your design documents and your code to this repository. Consult the appendix for guidance on how to make a new Maven project.
+
+## Milestone 2a: Design and Implementation
+
+You will analyze, design, and implement the game Santorini without god cards (see appendix for rules). You should focus on the game-related functionality of the program, not its user interface. Think of playing the game by calling a sequence of methods, which you could execute in a test case; it is also helpful to think about and possibly sketch out the GUI and how it interacts with the game at this early stage. Note that the game (without god cards) is fairly simple, so you likely won't need more than a few classes/objects/methods.
+
+Textbooks often describe a sequential process where the solution is designed before it is implemented. You might find it more convenient to start with coding and iteratively change and refactor the code until you are happy with the design, to create UML diagrams as documentation after the fact. In practice, developers may shift between different strategies and orders of formal design, exploratory coding, and sketching diagrams. We recommend to start at least with some domain analysis and rough modeling. If you adopt a coding-first approach, make sure that you think carefully about your design and are willing to substantially change your code if you discover problems.
+
+### Analysis & Design
+
+For analysis and design we expect you to create a number of design documents.
+
+We strongly recommend to not auto-generate models from code with tools, as those are often of low quality. Diagrams should be consistent with one another and other diagrams submitted with the homework.
+
+**Deliverable 1: Domain model.** Create a domain model describing the important concepts of the game. Your domain model should be represented by a UML class diagram; you may optionally include a glossary. For more information on domain models, see Chapter 9 of Larman’s Applying UML and Patterns. Turn this in as domain-model.pdf in the root directory of your git repository.
+
+**Deliverable 2: System sequence diagram.** Create a system sequence diagram identifying all interactions between a user and the system when the user plays the game. The system sequence diagram should help you determine what interactions the high-level system makes available to its users. For more information on system sequence diagrams, see Chapter 10 of Larman’s Applying UML and Patterns. Turn this in as system-sequence-diagram.pdf.
+
+**Deliverable 3: Behavioral contract.** Provide a behavioral contract for the following interaction initiated by the user: _The user attempts to move a worker_. The contract should explicitly describe the preconditions and postconditions for the interaction, and your behavioral contract should be consistent with your domain model and interaction diagrams. Constructing behavioral contract should help you envision important changes of internal state of the game when a player interacts with the game. You may provide explicit examples to clarify your contract. For more information on contracts, see Chapter 11 of Larman’s Applying UML and Patterns. Turn this in as contract.pdf.
+
+**Deliverable 4: Object model.** Create an object model of your game, documented as a UML class diagram. The object model should describe the classes and interfaces of your design, as well as their key associations (with cardinalities), attributes, and methods. For more information on class diagrams, see Chapter 16 of Larman’s Applying UML and Patterns. Model only the core of the game, not GUI elements or test code. Turn this in as `object-model.pdf`.
+
+**Deliverable 5: Justification for handling state.** The implementation needs to store state about the status of the game (at least players, current player, worker locations, towers, and winner). One key design question is usually what objects should store what state. For each kind of state the game needs to store explain where you store it. Using the template provided in the starter repository, provide a justification (with reference to design goals/principles/heuristics) for your responsibility assignment for state; discuss the alternatives you had considered and the trade-offs they entailed that led you to choose this particular design (essentially, your design process). Ensure that your answer is consistent with your object model. Turn this in as `state-justification.md`.
+
+**Deliverable 6: Justification for building action.** Reason about how the implementation determines what is a valid build (either a normal block or a dome) and how it performs the build. Identify what actions are needed and which objects and methods are responsible for performing those actions. Provide a justification (with reference to design goals/principles/heuristics) for your decision on assigning responsibilities; discuss the alternatives you had considered and the trade-offs they entailed that led you to choose this particular design (essentially, your design process). Include the relevant parts of an **object-level interaction diagram** (using method names and calls) for your final design. For more information on interaction diagram notation, see Chapter 15 of Larman’s Applying UML and Patterns. Turn this in as `build-justification.pdf` containing both the text of your answer and the interaction diagram.
+
+In summary, we expect 6 files for the design part of this assignment: `/domain-model.pdf`, `/system-sequence-diagram.pdf`, `/contract.pdf` (for moving a worker), `/object-model.pdf`, `/state-justification.md` (for responsibility assignment regarding state), and `build-justification.pdf` (for responsibility assignment regarding the build action).
+
+To submit these documents, (a) push them to the root directory of your Santorini repository on Github and (b) submit them as a zip file for peer review to Canvas. _Do not include your AndrewID or name in any of the documents so that peer review can be performed anonymously._
+
+### Implementation & Test
+
+Implement the game in Java. As usual, document your code for all public functions.
+
+It is encouraged that your tests should include unit tests as well as integration tests that set up the game and play sequences of turns. To achieve that, it is a good strategy to write tests while you implement each function, and go back to add a little more tests in case you missed any important test cases and functionality after you complete your implementation.
+
+There is no specific numeric goal for testing (neither for your codes or for our grading), but we expect to see tests of individual key functions (e.g. move and build functions) and tests of sequences of multiple actions of game play. But we are NOT looking for coverage of every possible corner case, and we will NOT inject bugs to evaluate the bug-finding ability of your test suites. Remember that this homework is not all about tests, and you should not spend too much time writing **complete** test suites. However, as a useful and necessary step in software construction, tests are helpful in that they can help you build confidence that your implementation is correct at a high level and that your interfaces are easy to use.
+
+We would like you to run your code by calling the methods directly. We do not expect a user interface, either in command line or graphical, in this assignment. You may find it useful to create a simple command line interface when you are developing the code, but we don’t expect or recommend that you do so.
+
+Your implementation should determine when somebody has won by moving to the third level. You do not need to detect that a player won because the other player cannot move.
+
+You should update your design documents from milestone 2a based on insights gained from the implementation. You can develop models and code in any order and typically there will be some iteration. However, we expect that the submitted final models and code align.
+
+**Deliverables:** Commit all your code to your GitHub repository and ensure that your project is built and tested on Github Actions -- which you will need to set up yourself (see appendix 3).
+
+## Milestone 2b: Peer Review
+
+You will review other solutions to milestone 2a and will point out design problems. This is an exercise in critically reflecting on other designs and identifying common design problems.
+
+About 3 days after the milestone 2a deadline, we will assign you 2 or 3 design documents (not code) from milestone 2a. In addition to solutions from other students, we might provide you with designs from the course staff that have known problems. You will submit your reviews of these solutions according to a provided rubric on Canvas. Your reviews will be visible to author of those solutions. Reviews are anonymous (reviewers will not know the authors of the solutions and authors will not know the identity of the reviewers). Your reviews should be conducted through the Canvas peer review system with the rubric, not simply as comments for each assigned review.
+
+We will evaluate whether your reviews correctly point out design problems that exist or incorrectly point out problems where code is well designed.
+
+(We do not expect you to spend more than 1 hour per review.)
+
+## Milestone 2c: Revised Design and Implementation
+
+Based on our milestone 2a feedback and peer feedback received after milestone 2b, you now have the opportunity to redesign your solution. We encourage you to rethink your design based on the feedback and refactor it or start from scratch. If your solution for milestone 2a received full credit and you received no useful feedback from milestone 2b, you do not need to perform any changes and can submit the same commit URL.
+
+You may use other design ideas you saw in milestone 2b as inspiration to improve your own design, but you are fully responsible yourself for the correctness the designs you submit.
+
+Briefly describe changes between your milestone 2a and 2c solution (if any) in `/changes.pdf` or `/changes.md`.
+
+We will assess milestone 2c with the same rubric as milestone 2a. We are looking for the same deliverables as in milestone 2a.
+
+## Submitting your work
+
+For milestone 2a, submit your work in two locations: (1) Submit a link to your final commit to Canvas. All design documents should be located in the root directory of your repository. (2) Upload all 6 design documents in a single zip file (not including any code or other files) to Canvas for peer review. **Make sure your submissions for 2a do not include your AndrewID or your name. These submissions will be assigned to your classmates for peer review.**
+
+For milestone 2b, you will perform code review directly on Canvas.
+
+For milestone 2c, you will again submit a link to your final commit to Canvas. All design documents should be located in the root directory of your repository.
+
+As usual, the link must have the format `https://github.com/CMU-17-214-Students//commit/`.
+
+## Evaluation
+
+The assignment is worth 230 points total, divided as follows:
+
+* 30 points for submitting reasonably complete designs and implementation at Milestone 2a
+* 170 points for the correctness/quality of the designs and implementation, assessed in both Milestone 2a and Milestone 2c. We will only count the Milestone 2c grade.
+* 30 points for peer review in Milestone 2b.
+
+_If the submitted link does not have the right format, we will not be able to grade your solution and will assign 0 points._
+
+Specifically, we expect to grade the homework with the following rubric:
+
+### Initial submission (30 points, milestone 2a)
+
+1. [ ] 10: The GitHub submission includes a reasonably complete version of all design documents that demonstrate a good-faith attempt at modeling the problem (`domain-model.pdf`, system-sequence-diagram.pdf, contract.pdf, `object-model.pdf`, `build-justification.pdf`, and `state-justification.md`)
+1. [ ] 10: The design documents and only design documents are submitted in a zip file to Canvas without obvious identifying information (no name or AndrewID in any of the documents)
+1. [ ] 10: The GitHub submission includes reasonably complete code and tests that demonstrate a good-faith attempt at implementing the game.
+
+### Domain analysis (25 points, milestone 2a/c)
+
+1. [ ] 10: The domain model in file domain-model.pdf describes the vocabulary of the problem with reasonable completeness, uses suitable notation (right UML boxes, named associations with cardinalities, association vs field, reasonable naming), and is at the right level of abstraction
+1. [ ] 10: The system sequence diagram in file system-sequence-diagram.pdf is reasonably complete, uses suitable notation, and is at the right level of abstraction.
+1. [ ] 5: The behavior contract in file contract.pdf is reasonably complete regarding pre- and post-conditions and at the right level of abstraction.
+
+### Object-oriented design and justification (70 points, milestone 2a/c)
+
+1. [ ] 15: The object model in file `object-model.pdf` is reasonably complete, uses suitable notation (right UML boxes, named associations with cardinalities, association vs field, reasonable naming), and is at the right level of abstraction.
+1. [ ] 10: The interaction diagram in `build-justification.pdf` is reasonably complete, uses suitable notation, is at the right level of abstraction, and is consistent with the object model (called methods exist in target class, caller has access to target objects).
+1. [ ] 20: Responsibility assignment for the state is clearly explained, appropriate and well justified in `state-justification.md`. We will check:
+ * a. It is clear from the description where players, current player, worker locations, towers, and the winner are stored.
+ * b. The description matches the object model.
+ * c. The responsibility assignment for each piece of state is justified with suitable design vocabulary (design goals/principles/heuristics/patterns). The assigned responsibilities and justifications are plausible.
+ * d. The justification demonstrates an engagement with design principles and tradeoffs, and discusses design alternatives in a meaningful way.
+
+1. [ ] 20: Responsibility assignment for checking and performing build actions is clearly explained, appropriate, and well justified in `build-justification.pdf`. We will check:
+ * a. It is clear from the description what checks are performed to determine whether a build action is valid and how the state of the game is updated when the action is performed.
+ * b. The description matches the interaction diagram.
+ * c. The responsibility assignment for each method involved in checking and performing builds is justified with suitable design vocabulary (design goals/principles/heuristics/patterns). The assigned responsibilities and justifications are plausible.
+ * d. The justification demonstrates an engagement with design principles and tradeoffs, and discusses design alternatives in a meaningful way.
+
+1. [ ] 5: Responsibility assignment for checking and performing a move action is appropriate (as recognizable from the object model and implementation; no description or justification requirement).
+
+### Implementation and testing (75 points, milestone 2a/c)
+
+1. [ ] 30: All core functionality of the game is implemented and follows all rules as specified. Specifically we check that your code does the following: initializes the game, rejects invalid moves, rejects invalid builds, updates the state after moving, updates the state after building, determines the winner, ends the game
+1. [ ] 10: The implementation aligns with models. We will look for: same names, state and methods in the same classes/objects, associations' cardinalities reflect implementation, and interactions possible as shown in diagrams.
+1. [ ] 10: The implementation is well tested, using both unit tests and integration tests. The key functions like validating a move, a build, and tests of sequences of game play are tested at a reasonable level. The tests follow good practices (e.g. redundancy, independence, readability. NOT including the completeness of test suites).
+1. [ ] 5: The public methods of the code are well documented.
+1. [ ] 5: The build and tests are automated on Github Actions and succeed.
+1. [ ] 5: Commits are reasonably cohesive; commit messages are reasonable.
+1. [ ] 10: The implementation practices reasonable style, and the codes can pass a reasonable linter check (e.g. checkstyle.xml from previous homework).
+
+### Peer review (30 points, milestone 2b)
+
+1. [ ] 10: Reviews are provided for all solutions, following the provided rubric.
+1. [ ] 10: The reviews identify real design problems, if any.
+1. [ ] 10: The reviews do not point out good design decisions as problems, if any.
+
+## Appendix 1: Santorini Rules
+
+Santorini has very simple rules, but the game is very extensible. You can find the original rules [online](https://roxley.com/products/santorini). You can find a copy of the game in the common space of TCS Hall on campus. Beyond the actual board game, you can also find a mobile app that implements the game if you want to try to play it.
+
+In a nutshell, the rules are as follows: The game is played on a 5 by 5 grid, where each grid can contain towers consisting of blocks and domes. Two players have two workers each on any field of the grid. Throughout the game, the workers move around and build towers. The first worker to make it on top of a level-3 tower wins. Note that though the official rules require that if a player cannot further move any worker, they will lose, **you do not need to automatically detect this winning condition in your solution**. You also don’t need to handle more than two players.
+
+As set up, both players pick starting positions for both their workers on the grid. (For simplicity, in Homework 2 and 6, _you can assume a player A always starts_). Players take turns. In each turn, they select one of their workers, move this worker to an adjacent unoccupied field, and afterward add a block or dome to an unoccupied adjacent field of their new position. Locations with a worker or a dome are considered occupied. Workers can only climb a maximum of one level when moving. Domes can only be built on level-3 towers. You can assume there are infinite tower/dome pieces to play.
+
+That's it. You probably want to play a few rounds to get a feel for the game mechanics. There are god powers that modify the game behavior, but those will not be relevant until Homework 6.
+
+## Appendix 2: Notation & Tools
+
+To ease communication and avoid ambiguity, we expect all models to use UML notation for class and sequence diagrams. Chapters 9, 10, 15, and 16 of Larman’s Applying UML and Patterns provide many details and guidance on UML notation. We do not require much formality, but we expect that associations are used rather than attributes where appropriate and that each association includes a name and cardinalities. Attributes and methods should be specified correctly, but we do not require precise descriptions of visibility or types.
+
+It is important that your models demonstrate an understanding of appropriate levels of abstraction. For example, your domain model should not refer to implementation artifacts, and your object model should not include low-level details such as getter and setter methods, unless they aid the general understanding of your design.
+
+UML contains notation for many advanced concepts, such as loops and conditions in interaction diagrams. You may use UML notation for these advanced concepts, but we do not require you to do so. If you find you need advanced concepts, you may describe such concepts with your own notation or textual comments, as long as you clearly communicate your intent.
+
+To maximize clarity, we recommend that you draw UML diagrams with software tools. We do not require specific tools, and you may share tool-related tips on Piazza. There are several easy to use online tools like [Draw.io](https://draw.io/) and [Yumly](https://yuml.me/), and also many desktop tools and IDE plugins. We strongly recommend that you do not mechanically extract models from a software implementation; such mechanically generated models are almost always at an inappropriate level of abstraction. We will accept handwritten models or photographs of models (such as whiteboard sketches) if the models are clearly legible.
+
+## Appendix 3: Setting up your project
+
+For Java, you can generate the default setup for a Maven project from the command line with `mvn archetype:generate` and use `maven-archetype-quickstart` as the template. This will set up an initial `pom.xml` file and some example directories.
+
+We recommend to set up the Checkstyle plugin. You can look at the `pom.xml` file from homework 1 for how to do this (`maven-checkstyle-plugin`) and can also copy the checkstyle configuration in `checkstyle.xml`.
+
+We recommend to set up a `.gitignore` file to avoid committing generated files. See homework 1 for an example.
+
+We require you to set up GitHub actions to compile and test the project. You can adapt the setup from homework 1 in `.github/workflows`.
+
+Further reading: [Maven - How to create a Java project](https://mkyong.com/maven/how-to-create-a-java-project-with-maven/), [Maven Archetype Plugin – archetype:generate](https://maven.apache.org/archetype/maven-archetype-plugin/generate-mojo.html), [Maven – Introduction to the POM](https://maven.apache.org/guides/introduction/introduction-to-the-pom.html), [Maven – Maven in 5 Minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html), [ignoring files in Git](https://www.atlassian.com/git/tutorials/saving-changes/gitignore), [Quickstart for GitHub Actions](https://docs.github.com/en/actions/quickstart)
diff --git a/previous-assignments/hw3.md b/previous-assignments/hw3.md
new file mode 100644
index 0000000..94d583f
--- /dev/null
+++ b/previous-assignments/hw3.md
@@ -0,0 +1,112 @@
+# Homework 3: Unit Testing
+
+In this assignment, you will test the FlashCards system that you expanded in the previous homework.
+
+This assignment will give you experience creating unit tests against a specification and to cover code with tests as you write it. You will practice following dedicated testing strategies and best practices for unit testing. You will automate your tests with continuous integration and use test coverage tools.
+
+Specifically, you will perform *structural testing* for the Java implementation and *specification testing* for the TypeScript implementation in your Homework 1 repo.
+
+## Starter code
+
+Continue to work with the code from Homework 1. If you have made any changes to file names or interfaces in the provided code in the directories `cards`, `data`, or `ordering` please restore them to the original names and interfaces and do not change them in this assignment.
+
+If you prefer a fresh start, you can start over by creating a new branch off the first commit (find id of the first commit with `git log` in branch and follow these [instructions](https://stackoverflow.com/questions/7167645/how-do-i-create-a-new-git-branch-from-an-old-commit)) and then copy over your implementation for `RecentMistakesFirstSorter`. Your hw1 implementation of the command-line parser is not relevant for this homework.
+
+## Tasks
+
+### Part 1: Infrastructure setup
+
+Set up the project so that you can write and execute unit tests. We explain *JUnit* and *ts-jest* both in class and provide an example setup in a lab, but you are welcome to use other test frameworks. Make sure that tests are automatically executed with `mvn test` or `npm test` and as part of the GitHub Actions build. We recommend also to identify how you can view test coverage in your IDE or in a generated report.
+
+
+### Part 2: Specification-base testing (TypeScript)
+
+Read the public interface specification of every method in the FlashCard **TypeScript** source code, except the exclusions below (don't forget your new `recentMistakesFirstSorter`). Write test cases in **TypeScript** that check whether the implementation covers the specification completely and precisely as best as possible -- even if the implementation is wrong! You may find implementation issues in your newly added `recentMistakesFirstSorter`; make sure to fix such bugs so that your tests all pass.
+
+That means:
+
+- Consider the input space and the specification to *intentionally* select valid and invalid inputs as tests.
+- Write a test that confirms that everything that is stated works as expected. Guard against "typical" mistakes, such as off-by-one errors or forgetting to implement one part of a multi-faceted specification.
+- Do not test what is not specified. Many specifications allow some flexibility and tests should not reject valid implementations of a specification. For example, if the potential nullity of a parameter is not stated, do not write a test that fails if the parameter is `null`. That might be intuitively (and realistically) undesirable behavior, but if it is not in the specification, it should not be tested. (Specifications are often a bit incomplete like that; writing comprehensive specifications can be tedious.)
+- Ideally, follow a test design strategy discussed in class, such as *boundary value analysis*.
+
+The goal is to achieve 100% specification coverage and to write tests that are good at detecting defects. Note that specification coverage is not automatically measurable.
+
+We will evaluate the quality of your tests by injecting bugs into the implementations to see whether your tests catch them. We will also inject allowed changes to the implementation that do not violate the specification to see whether your tests still pass as expected. You can perform the same kind of experiments yourself to evaluate the quality of your tests by injecting some mistakes yourself (e.g., replacing `<` by `>` or by `<=`, injecting off-by-one errors by adding `+1` to expressions, or checking if the questions and answers are case-insensitive).
+
+When writing test cases, make sure you follow good practices for test design, as discussed in class and the reading.
+
+**What to test.**
+
+Minus the below exceptions, you should test **all TypeScript functions that have specifications** in the original code base, including the new `recentMistakesFirstSorter` that you added.
+
+You do _not_ need to test:
+
+- `toString`, `get*` methods: these contain trivial or non-essential functionality. Your tests may, of course, use getter methods.
+- `index.ts` and any code written for parsing command line options: these depend heavily on your implementation in homework 1, for which we specified no interface.
+- `loadCards` in `store.ts`: this deals with I/O.
+- `cardshuffler.ts`: randomness is hard to test.
+- `ui.ts`: you will not need to test UI.
+
+Please note that the last four exclusions would not be industry-standard. They are nontrivial to test, though. We will show you later in the course how you can test such functionality.
+
+Our reference implementation has about 40 tests. As a hint, for `cardorganizer.ts`, there are many different possible combinations of sorters and repeaters. You should _not_ need to test all combinations to achieve suitable specification coverage!
+
+
+### Part 3: Structural testing (Java)
+
+For the Java implementation, write structural tests for the same files you tested in Part 2 to achieve 100% *branch* coverage. You do not need to test files that were excluded in Part 2, nor do you need to test files in the `Achievements` directory. Branch coverage is not required for files that are not part of your testing scope. We will not evaluate your test quality for the source code with injected bugs; the goal is to maximize code coverage for the relevant files.
+
+As in Part 2, follow the best practices for unit testing.
+
+**Report coverage**
+
+Extend the project's build system (Maven's `pom.xml`) so that it creates a coverage report with `mvn site`. Lab 6 provides a template. After you are finished with your tests, when you generate and open a coverage report, you should see 100% branch coverage for the relevant package.
+
+### Part 4: Documentation and Reflection
+
+Add a file `reflection.md` to the root folder of your repository with the following sections:
+
+In section **Testing strategy** briefly describe whether you followed any specific test case design strategy, such as boundary value analysis, when creating tests. Briefly explain, why you did or did not use these techniques. (about 1 paragraph)
+
+In section **Specification vs structure testing** briefly reflect on your experience with the two different testing approaches. Was one harder or better than the other for you? (about 1 or 2 paragraphs)
+
+If you used AI tools such as ChatGPT or Copilot for any part of homework 1 or 2, add a section **AI Tools** describing what you tried them for and whether you found them useful (open ended).
+
+## Submitting your work
+
+Always submit all code to GitHub. Once you have pushed your final code there, submit a link to your final commit in the format `https://github.com/CMU-17-214-Students//commit/` on Canvas (the link identifies the right commit and branch for us, in case you do not work in the main branch). You can get this link easily when you click on the last commit (above the list of files) in the GitHub web interface.
+
+## Evaluation
+
+The assignment is worth 100 points. We will grade the assignment with this rubric:
+
+* [ ] Submissions that do not provide a link in the expected format can not be graded and will not receive credit.
+
+**Specification-based Tests in TypeScript (30pt):**
+
+- [ ] 10: No tests fail on a correct implementation. We will swap out the code in `cards`, `data`, and `ordering` for five different correct implementations of the provided specification. Points will be awarded proportional to the number of implementations that pass your test suite.
+- [ ] 20: At least one test fails for each of about 20 bugs we introduce in an otherwise correct implementation. We will run your code against multiple new implementations in `cards`, `data`, and `ordering` that are entirely correct except for a single bug. One or more of your tests should fail because of said bug. Points will be awarded proportional to the number of bugs discovered by your test suite.
+
+**Structural Tests in Java (20pt):**
+
+- [ ] 20: Test cases achieve perfect branch coverage on the required classes (10pt partial credit for >90% branch coverage).
+
+**Test Quality (20pt)**
+We will analyze 5 randomly sampled tests:
+- [ ] 5: Tests are independent.
+- [ ] 5: Tests are cohesive and small.
+- [ ] 5: Tests avoid excessive redundancies.
+- [ ] 5: Tests are readable (e.g., meaningful names, comments).
+
+**Infrastructure and style (20pt):**
+
+* [ ] 5: The project is set up to generate coverage reports for Java (on the command line or in a file) with `mvn site`
+* [ ] 5: GitHub Actions runs tests for the TypeScript and Java code automatically.
+* [ ] 5: The build passes on GitHub Actions
+* [ ] 5: Most commits are reasonably cohesive and most commit messages are reasonably descriptive
+
+**Reflection (10pt):**
+
+- [ ] 5: Your writing on your testing strategy demonstrates an understanding of one or more relevant test case design strategies and supports your decision whether or not to adopt these.
+- [ ] 5: Your reflection on the two forms of testing shows that you have given thought to the strengths and weaknesses of each based on your experience. The reflection is grounded in concrete experiences, not generic statements.
diff --git a/previous-assignments/hw4.md b/previous-assignments/hw4.md
new file mode 100644
index 0000000..34611c6
--- /dev/null
+++ b/previous-assignments/hw4.md
@@ -0,0 +1,143 @@
+# Homework 4: Design and Testability Improvement of a Static Website Generator
+
+In this assignment, you will work with an existing non-trivial code base that has several design and testability flaws. This mirrors a common setting in practice where you will join a team that has already a code base to work with and that code base is not in the best shape but still needs to be extended and maintained. You will work to improve the design of the program without changing its behavior (known as refactoring). You will not fix all issues but will make some improvements to the code base. You will spend most of the time reading existing code and looking for design problems. For changes you make, you will justify your changes with the design vocabulary (design goals, principles, heuristics, patterns) introduced in class.
+
+This assignment will give you more experience with critiquing object-oriented design and deliberately applying various design strategies, in a small and incremental fashion.
+
+## Context
+
+**Static website generators.** Static website generators are tools that generate [static web pages](https://en.wikipedia.org/wiki/Static_web_page) from various inputs. It allows users to create and customize web pages without writing HTML code directly. This can be used for project pages but also for sophisticated content managment systems. At the same time, static web pages are cheap and easy to deploy and host and do not require a server that interprets code when serving web pages. For example, they can be hosted on [CMU web space](https://www.cmu.edu/computing/services/comm-collab/websites/awps/index.html). Commonly, the page is simply regenerated when any of the inputs change, possibly automated.
+
+Static web sites have become very popular with [GitHub Pages](https://pages.github.com/). By default, GitHub uses [Jekyll](https://jekyllrb.com/) as a popular static web site generator, but [many other exist](https://staticsitegenerators.net/) and it can be easy to write a custom one. Sometimes it is easier to write a new generator then try to work with the complexity or limitations of existing ones. For example, the 17-214/514 web page was generated with a custom static website generator, taking as input Markdown files, a Google Calc spreadsheet with the schedule, and a directory with slides.
+
+**The project.** In this homework, you take over a custom static website generator written to support a webpage for student clubs, that contain articles and events. The code is kind of functional, but not quite finished, and it is poorly designed in many ways. The original authors wanted to introduce events and a calendar and have written much of the code for it, but the complexity got out of hand so it was never finished. Additionally, noone has worked on making the produced website look nice yet. Documentation is fairly sparse and there are no automated tests, just an example project.
+
+The project roughly works like this: Everything is organized as a project (top-level directory). A project has a title and is owned by an organization, configured in a YAML file. Each directory represents an event or an article. Events and articles can have other events or articles within them. Events or articles can have pictures and videos. They can be organized by topics (tags). Events have a name and a start and end date. The front page lists recent article/events and a calendar of upcoming events.
+
+The project has three stages: a parser loads data ([Markdown](https://daringfireball.net/projects/markdown/) files, [YAML](https://en.wikipedia.org/wiki/YAML) files, etc.) from the disk (`parser` directory), the loaded data is represented as internal data structures (`project` directory), and finally, the content is written as HTML files (`rendering` directory) using a template engine. A command-line interface (`CLI`) coordinates all of this and can print summaries and statistics.
+
+**Refactoring.** Refactoring is the improvement of code without changing its functionality. For example, to address the anti-pattern of a god class and improve cohesion of the implementation, a developer may decide to move methods from one class to another (and update all calls to the method). This change improves design but does not modify functionality; the same method will still be called, just in a different place. Many refactorings are done manually, but some can be automated by IDEs. Simpler things like renaming variables or extracting code to a new method are well supported, but even more complex operations like extracting an interface from a class or pushing methods along class hierarchies are implemented in some IDEs. It is usually a good idea to commit regularly as you refactor and make changes. If something goes wrong, you can always go back to the last commit.
+
+**Relationship to real-world projects.** When joining a software engineering team in industry you almost always will join an existing project rather than starting from scratch. Most projects will be much much bigger than this one and documentation is rarely, if ever, great. The amount of testing done also differs wildly between organizations. Reading existing code and understanding a subsystem without needing to know everything about every detail of the code is an important and very common skill. Research shows that software engineers in practice often spend much more than 50 percent of their time on understanding existing code rather than writing new code. Taking notes when reading the code or sketching UML diagrams or other diagrams of the structures in a program (usually informally and incompletely) is quite common to get an overview and understanding how pieces of a system fit together.
+
+Real-world code often has design problems, where prior code was poorly written or the problem changed and the software has only been patched as necessary. Teams rarely have the luxury of rewriting an entire system from scratch. Additionally, no one wants to do massive code changes out of fear of breaking existing functionality. Teams often even have a hard time getting permission to do minor improvements when management thinks they could work on new code instead (this has lead to an entire discussion around "[technical debt](https://en.wikipedia.org/wiki/Technical_debt)" as a way to get management to provide time for maintenance). In practice, it is much more common to do small and incremental design fixed as one continues to develop the system (following the boy scout rule ["leave your code better than you found it"](https://deviq.com/principles/boy-scout-rule)). Practitioners use automated refactorings a lot, but also do many manual ones. Sometimes a somewhat larger redesign might be necessary to enable new functionality, but also here it will usually only affect a small part of the system.
+
+In this assignment, we intentionally expect you to be very explicit about arguments about why certain designs are bad and how they can be improved. In addition, we require you to create a partial object model for one of your fixes. While you may not write this all down in practice, sometimes you may need to make similar arguments to colleagues to argue why a specific change is beneficial (when it is always easier to leave the code as is). We provide guidance for identifying certain kinds of design problems.
+
+You will do multiple small design improvements and one slightly larger redesign to solve a specific problem ("SubSubSubSubSubArticles"). These design improvements will only refactor code, without adding new functionality. You can consider this as a useful step for preparing for adding the new functionality for events in the future.
+
+## Design Problems
+
+In this assignment, you will address one instance of each of the following design problems:
+
+1. **Code Duplication** -- duplicate code that could be abstracted and reused using methods, inheritance, delegation, or design patterns
+2. **Coupling** -- unnecessary coupling
+3. **Cohesion** -- objects, classes, or methods that severely violate cohesion (e.g., god class)
+4. **SubSubSubSubSubArticles** -- the way nested articles are represented in the implementation is problematic
+
+## Testing Problems
+
+Luckily, this code comes with tests that you can run with `mvn test`! However, the testing infrastructure is tiny, and each of the tests, or the code it tests, violates one or more of the SOLID principles. We have listed the principles for you below.
+
+1. **Single responsibility** -- Each test should only have a single reason to fail
+2. **Open-Closed Principle** -- Designs should be open for extension, but closed for modification. You should be able to extend what a class does without changing its source code
+3. **Liskov Substitution Principle** -- Each superclass should be replacable with an object of its subclasses without breaking the application
+4. **Interface Segregation Principle** -- Clients should not be forced to depend on interfaces that they do not use
+5. **Dependency Inversion Principle** -- High-level classes should not depend on low-level classes.
+
+## Task
+
+We ask you to perform the following tasks:
+
+### Improve design
+
+ Your task is to incrementally and in small steps improve the design and implementation of the project to make it easier to maintain and extend in the future. You do *not* need to implement new functionality or add new tests for this part of the assignment.
+
+*Step 1:* Look for a design problem in the implementation that fits one of the design problems listed above. You will probably need to spend quite some time getting an overview of the code and understanding parts of it.
+
+*Step 2:* Create a [GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-an-issue) using our provided template with the design problem in the title (e.g., "Fix coupling problem"). The issue text should point out a specific problem at a specific location in the code and explains *why* the specific code is problematic (e.g., why the coupling is bad in this specific case).
+
+*Step 3:* Fix the design problem and commit the fix with a meaningful commit message.
+
+*Step 4:* Close the issue with a message that explains *how* you fixed the issue and link the issue to the commit that fixed it. A fix may address multiple problems, and the same commit can be linked in multiple issues.
+
+*Step 5:* Repeat the steps above until you have addressed all 4 design problems.
+
+We expect 4 closed issues with links to one or more commits after the design improvement.
+
+### Improve Testing
+
+You should also improve the tests included in the repository. This may require modifying the tests and/or modifying the code itself.
+
+*Step 1:* For each test provided, identify which SOLID principle(s) is violated by the test itself or the code that it tests. A test may violate multiple principles, and all principles are not necessarily violated.
+
+*Step 2:* Create a [GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-an-issue) with the name of the test in the title (e.g., "Fix `ArticleTest.java`"). The issue text should identify which SOLID principle or principles is violated by the test, and explain *why* it violates it and why this is undesirable. Use the same GitHub issue template as above.
+
+*Step 3:* Fix the test and/or the code problem with a meaningful commit message, ensuring the same functionality is tested and nothing more. You may need to add additional tests or files.
+
+*Step 4:* Close the issue with a message that explains *how* you fixed the issue and link in the issue to the commit that fixed it. A fix may address both a design problem and a testing problem, and can be linked to multiple issues.
+
+*Step 5:* Repeat the steps for all 4 of the included tests.
+
+We expect 4 closed issues, one for each of the tests, with links to one or more commits for test improvement.
+
+### Document structure change
+
+For the "SubSubSubSubSubArticles" problem **only**, create a partial *object model* of the system *after* your fix. It should only involve the classes related to articles as needed to explain your fix. Make sure the diagram is consistent with your final implemented solution.
+
+Commit the diagram as `sub-articles.pdf` in the root directory of the branch you are working on.
+
+## Hints for design problems
+
+The code has many problems, and several methods are in the wrong place. Some methods clearly do a lot more work than they should and depend on knowing details of other objects. There is a lot of encapsulation violation throughout the code. The way topics are stored is weird. The way sorting is managed seems rather inflexible and repetitive. There is a lot of copy pasted code that could be abstracted, including several methods in several files and entire files. There are lots of `instanceof` checks that are a sign of possibly bad design. Some of these problems may benefit from using a design pattern, but for most problems a design pattern is not needed. Usually, reasoning with design heuristics and design principles is sufficient.
+
+One part of the design seems particularly problematic: The way articles are nested is very hard to extend (design problem "SubSubSubSubSubArticles" above). There is one design pattern we discussed in lecture that would make this design much better, where the same operations can be applied to articles, subarticles, and content of those articles uniformly in a hierarchy. Making this change is nontrivial and will require changes to multiple code fragments where articles and their content is used. You can probably delete the SubArticle and SubSubArticle classes afterward. You may want to start with a few smaller problems to get familiar with the code base before getting to this one.
+
+**Reusing design changes.** Note that some design fixes can address to multiple of the design problems above. For example, the fix to "SubSubSubSubSubArticles" will likely address multiple other design problems too. Hence it may be possible to close multiple issues with the same fix. Keep in mind that your explanations for why the design change you made fixed the issue will most likely need to be different.
+
+**Excluded code.** Focus primarily on the data structures to represent the project (`project` directory) and how it is used by the `Renderer` and the `CLI`. You can ignore the parser (file `ProjectParser`). We also do not expect you to make any changes to the template engine (in file `TemplateEngine` and the `data` directory and `.hbs` and `.css` files) though you may need to understand what is generated here to understand other parts of the program.
+
+## Submitting your work
+
+Always submit all your changes to GitHub. Once you have pushed your final code and the partial object model there, submit a link to your final commit on Canvas. A link will look like `https://github.com/CMU-17-214-Students//commit/`. You can get to this link easily when you click on the last commit (above the list of files) in the GitHub web interface. We expect to find (closed) issues in the repository you link to.
+
+## Evaluation
+
+The assignment is worth 110 points. We expect to grade the assignment approximately with this rubric:
+
+- [ ] 20pt: The implementation was improved in some form. The improved implementation now passes on GitHub Actions and provides the same functionality as the original implementation. Improvements like supporting deeper nesting of articles or supporting events are okay, but breaking the existing functionality is not.
+- [ ] 24pt: For each of the first 3 design problems (code duplication, coupling, cohesion; not "SubSubSubSubSubArticles"):
+ - [ ] 4pt: There is an issue on GitHub that (a) names the design problem in the title, (b) identifies an instance of the problem in the code, and (c) explains *why* this is a problem. The issue's text demonstrates an understanding of the design problem.
+ - [ ] 4pt: The issue is (a) closed with (b) a description of the fix and (c) a link to the commit(s) that contain the fix so that we can find the fix in the implementation. The change indeed improves the design as described without introducing new obvious design problems.
+- [ ] 32pt: For each of the 4 tests in the code:
+ - [ ] 4pt: There is an issue on GitHub that (a) names the test in the title, (b) identifies which of the SOLID principles is violated, and (c) explains *why* this is a problem. the issue's text demonstrates an understanding of each of the design problems.
+ - [ ] 4pt: The issue is (a) closed with (b) a description of the fix and (c) a link to the commit(s) that contain the fix so that we can find the fix in the implementation. The change indeed improves the testability of the code without introducing new problems.
+- [ ] 14pt: For "SubSubSubSubSubArticles": An issue (named "SubSubSubSubSubArticles" or similar) describes why the old implementation was problematic. The issue is closed with a link to the commit(s) that contain the fix and a description of how it was improved in a way that demonstrates an understanding of design reasoning and the used design pattern (if any). The fixed implementation better handles articles and subarticles with less code duplication and better implementations for common functionality like `getTopics`, `printSize`, and parent/child relationships.
+- [ ] 10pt. The repository contains a partial object model in `sub-articles.pdf` in the root directory of your branch that describes the design fix for the "SubSubSubSubSubArticles" problem. It needs only include the classes involved with your fix. The diagram should be consistent with the actual implementation, use suitable notation, and be at the right level of abstraction.
+- [ ] 10pt: The Git commits are cohesive and have meaningful descriptions that indicate what fix they are part of. The changes did not introduce severe style or readability issues.
+
+*If the submitted link does not have the right format, we will not be able to grade your solution and will assign 0 points.*
+
+## Appendix: Technical Hints
+
+### Viewing the webpage
+
+The code can be executed with the provided sample project which executes most of the functionality of the project. To make this easier, we set up `mvn exec:exec` to execute the program with arguments `-d testProject --list-articles --all --list-events --topics --clean --size` which executes most code of the project. Of course, you can also run the program from within your IDE using a configured launch.json with these arguments. These commands generate a directory called `_static` by default that contains all the HTML and CSS files to render the webpage.
+
+When you initialize the starter repository, we recommend that you generate the webpage with the initial code and rename that directory (to e.g. `_static_original`), so you can have a reference to the original webpage. Refer to the [Testing Section](#testing) for the commands to re-generate the webpage directory as you refactor and ensure the new output is the same as the original. If you begin refactoring without doing so and want a reference, you can check out the initial commit and generate the webpage with the starter code.
+
+To view the webpage, go to the directory and open `index.html`. From VSCode, you can either click on 'Open in Default Browser' or 'Copy Path' and paste that into the address bar of your browser.
+
+### Testing
+
+The project includes automated tests that may be run with `mvn test`. Unfortunately, the tests included are not comprehensive, so shouldn't be relied on to verify that your fixes do not break the functionality of the project. To test this, you can compare the output produced by the program after your changes to the directory generated by the original code. While comparing the output on one example is not guaranteeing that the refactoring is behavior-preserving for all inputs, it provides assurance that nothing obvious was broken. To do this comparison, use a `diff` tool to compare the old generated output with the new one. Similarly you can save the command-line output into a file and compare the output before and after a fix. We recommend to perform the diff with
+
+```bash
+diff -r \
+ -I 'class="date">' \
+ -I 'class="created-date">' \
+ -I "last updated" \
+ _static _static_original
+```
+
+ where `__static_original` is the renamed original directory. This will produce a difference because of the timestamps, but they can be safely ignored. If no functionality was changed, there will be no output from this diff command. In addition, opening the `index.html` file for each the of the generated directories in your browser and visually comparing them is a quick way to help confirm the website generates properly.
diff --git a/previous-assignments/hw5.md b/previous-assignments/hw5.md
new file mode 100644
index 0000000..51ad1ee
--- /dev/null
+++ b/previous-assignments/hw5.md
@@ -0,0 +1,101 @@
+# Homework 5: Concurrency
+
+In this assignment you will work with concurrency in a Node backend. You will get experience with writing asynchronous code, and with error handling.
+
+## Starter code
+
+Find the starter code with the GitHub Classroom link on Canvas.
+
+You will work on a semi-completed program *SmilingFaces* to analyze faces in Wikipedia pages -- for example are more people smiling in pictures of the Carnegie Mellon Wikipedia page or in the University of Pittsburgh wikipedia page? In the web application, you can enter a *topic* for which a Wikipedia page exists and the program will identify all images in the page and determine with an ML model whether the picture contains smiling faces. It can also collect the pictures from other Wikipedia pages linked heavily from the target page ("include top neighbor topics").
+
+The starter code already handles all the communication with Wikipedia and the Google Cloud Vision API, but the backend code is currently written synchronously (which is actually quite difficult to do and very unusual for Node code). As a consequence the backend can only respond to a single request at a time and it is very slow. The provided implementation is also bad at error handling.
+
+The code consists of two related projects: The backend *express* implementation in the root directory and the frontend *React* implementation in directory `frontend`. Compile and run the code as follows:
+
+* First, build the frontend
+ * run `npm install` in the `frontend/` directory. (Note: deprecation and security vulnerability warnings here are expected)
+ * `npm run build` in `frontend/` to build the frontend, which will result in static pages in `frontend/build/`
+* Second, build and run the backend
+ * run `npm install` in the root directory
+ * `npm run compile` builds the backend, resulting in Javascript code in `dist/` as usual
+ * Make sure that you are signed into the Google Cloud API using `gcloud` (same as Lab 8)
+ * `npm run start` runs the server which you can then access at `http://localhost:8080`
+
+The backend serves the frontend code in the root of the web server but also provides API endpoints for starting a job (`POST /job`) and for getting results of a job (`GET /job/:id`) that both communicate in JSON format (using the [Long Running Operation with Polling Pattern](http://restalk-patterns.org/long-running-operation-polling.html)). The frontend will make requests to the APIs to update the state within the page. If a job is not completed on the first request, it will check every second for updates.
+
+In the user interface in the web browser you can enter a topic and start the analysis. Note that the response will take a very long time if you analyze any nontrivial pages. Analyzing the topic "Carnegie Mellon University" gathers and analyzes 30 images without neighboring pages (and many more with neighbors), which easily takes 30 seconds to respond. A good test page might be "David Tepper" which has only a single image and takes about 2 seconds to analyze.
+
+## Tasks
+
+**Concurrency in the backend.** Rewrite the backend to perform computations concurrently. We have the following requirements of the final implementation:
+
+* The server makes requests to Wikipedia and the Google Cloud API concurrently, speeding up responses significantly.
+* The server can answer multiple requests concurrently (i.e., multiple calls to `/job` and `/job/:id`).
+* The server reports an error when more than 5 jobs are processed concurrently asking users to try again later. Reject additional requests with HTTP error code 503.
+* The server never makes more than 5 concurrent requests to Wikipedia and never more than 5 concurrent requests to the Google Cloud API in order to not overload those servers (this limit is shared by all jobs).
+* If multiple topics are analyzed, the server does not wait until all images are collected from all topics, but starts analyzing images as soon as the images from each topic are identified.
+
+**Error handling.** Make the implementation robust to errors. Specifically we expect you to handle the following kind of errors:
+
+* When connections to Wikipedia or the Google Cloud API fail (error, timeout, or invalid results) retry two more times after a short wait of one second.
+* When connections to Wikipedia or the Google Cloud API fail and cannot be recovered or any other computations fail, report an error message to the frontend gracefully. Your server should still be able to handle 5 concurrent jobs and up to 5 concurrent backend requests afterward.
+* The backend validates inputs received from the frontend. Reject empty and invalid inputs with HTTP error code 400.
+
+**What to change:** This homework can be completed by only making changes to `backend.ts`, `visionapi.ts`, and `wikipediaapi.ts`. We plan to automate some testing of your code, as such, do NOT change the `Connections` interface and the signature of the `smilingFacesBackend` function. Also do not change the protocol between the backend and frontend. If we cannot grade your submission because you change any of these, we will assign zero points to that specific rubric item. Make all external calls through the APIs in `Connections` and do not make web calls with any other API. You may, and probably should, develop your own abstractions on top of the functions in `Connections`.
+
+## Submitting your work
+
+As usual, submit all your changes to GitHub. Once you have pushed your final code, submit a link to your final commit on Canvas. A link will look like `https://github.com/CMU-17-214-Students//commit/`. You can get to this link easily when you click on the last commit (above the list of files) in the GitHub web interface.
+
+## Evaluation
+
+This assignment is worth 100 points. We will grade the assignment with the rubric below. Submissions that do not provide a link in the expected format can not be graded and will not receive credit.
+
+Concurrency:
+
+* [ ] [10 points] The backend code makes use of concurrency to speed up computations for getting Wikipedia requests
+* [ ] [10 points] The backend code makes use of concurrency to speed up computations for analyzing images with the Google Cloud API.
+* [ ] [10 points] The backend code can process multiple jobs concurrently.
+* [ ] [10 points] The backend successfully completes computations and provides the results through the API.
+* [ ] [10 points] The backend rejects additional new jobs when processing 5 jobs concurrently with HTTP error code 503
+* [ ] [10 points] The backend correctly limits concurrency to at most 5 concurrent requests each to Wikipedia and Google.
+* [ ] [10 points] The backend can process images after images are identified from a topic, independent of other topics also to be analyzed.
+
+Error handling:
+
+* [ ] [5 points] The backend implements a retry mechanism for failed Wikipedia and Google connections, that makes two more attempts with a one second wait after each failed attempt.
+* [ ] [5 points] The backend recovers gracefully from failed Wikipedia and Google connections, reporting an error message to the client. Errors do not reduce the ability to perform work concurrently.
+
+Others:
+
+* [ ] [10 points] The backend code compiles on GitHub Actions.
+* [ ] [5 points] Commit messages are reasonably cohesive and have reasonable messages.
+* [ ] [5 points] The code is free of severe readability and style issues.
+
+## Appendix: Hints and Tooling Tips
+
+**How to start:** The code is functional as provided. Identify where the *sync* functions from `Connections` are called and understand how they are used. Incrementally turn synchronous functions in asynchronous ones by changing return type `T` to `Promise` and updating the implementation of the function and its call sides accordingly.
+
+It is difficult to make only local changes as incremental refactorings. It might be easier to change the entire WikipediaAPI or VisionAPI class at once. If necessary, comment out the vision API steps first and just get images from topics with and without neighboring topics. It might be useful to write simple tests for the calls to the Wikipedia API that can run outside the backend, e.g., with jest or with a simple main function just calling `newWikipediaAPI(new DefaultConnection()).getImageLinksFromTopic("David Tepper")`.
+
+**Implementation suggestions:** We recommend to use promises or async/await. It might be a good starting point to turn the provided connection functions with callbacks into promises. Beyond that you might find `Promise.all` useful.
+
+You can consider streams (`ReadableStream` of the Web Streams) for some of the work, but it is not required.
+
+The homework changes can all be fully implementing with plain Node code. Consider using the Proxy pattern to modularize error handling. If you like, you can use external libraries, such as `p-limit` or one of the many retry libraries.
+
+The execution order of concurrent code may not always be intuitive. Consider using a debugger or using print statements in the code to follow the execution.
+
+**Testing suggestions:** Writing tests may be useful, but is not required in this assignment. There are good opportunities for testing with stubs in the backend; the backend code is written in a way to make this testing easy by avoiding global functions. We do not suggest to test frontend code.
+
+A basic testing infrastructure is already setup in directory `tests/`, but there is only one test implemented. The example test uses stubs, but you can also run tests against Wikipedia and Google Cloud by just using the `DefaultConnection` class. Of course you can also test parts of your implementation without starting express, for example by writing tests for the functions in `wikipediaapi.ts`.
+
+While you are not required to automate tests, we will use tests in the style of the provided examples for grading.
+
+**Tooling suggestions:** If you want to send requests to the backend without running the frontend, you can send requests on the command line, such as
+
+```bash
+curl -X POST -H "Content-Type: application/json" -d '{"name": "David Tepper", "withNeighbors": false}' http://localhost:8080/job
+```
+
+With `npx tsc --watch` you can keep the TypeScript compiler running in a terminal and it will automatically compile changes whenever you safe a file. In a second terminal, `npx nodemon .` it will restart your application (the backend) after every change, that is, whenever the compiler has produced a new version. The test runner `jest` watches changes by default.
diff --git a/previous-assignments/hw6.md b/previous-assignments/hw6.md
new file mode 100644
index 0000000..dd57458
--- /dev/null
+++ b/previous-assignments/hw6.md
@@ -0,0 +1,155 @@
+
+# Homework 6: Return to Santorini
+
+In this final assignment, we return to Santorini and implement a user interface and god cards. This assignment has two milestones.
+
+* Provide a web-based *user interface* for people to play the game (both players share a screen) with React.
+* Make your implementation *extensible* to support god cards in Java. You will update your design and provide implementations for three god cards.
+
+You will continue with your Santorini code from Homework 2 in the same repository. We recommend to update your implementation and design documents based on feedback received for HW2, as well as fixing design issues will make it easier to extend the program and we will grade extended versions of these again, as described below. If you like you can create a new branch for this assignment.
+
+## Milestone 6a: User Interface
+
+Implement a web-based user interface for the game in React. The user interface should be functional, allowing two players (sharing a screen) to select the initial spots for their workers, and to play the game taking moves and build actions until one player wins. You can also allow two users connect to the same server from different browsers for a match, but this is not required and would be more difficult to implement.
+
+Generally, we leave details of the user interface to you. The user interface can be very simple. A five-by-five grid of buttons is likely sufficient with a button panel on the side for skipping optional actions and starting a new game. In the simplest case, you can represent workers by letters and towers with symbols on each button, e.g., `[[ ]]` for an empty level two tower, `[ X ]` for a tower with a worker from player *X*, and `[[[O]]]` for a tower with a dome. Background colors might indicate the active worker or valid locations for the next move or build. Text above the grid might indicate whose turn it is and what the next action is or who won. We do not grade for how pretty the game is.
+3
+In this homework, we are requiring you to implement the user interface using React. We recommend a client-server solution where a React frontend communicates over JSON with your Java backend. For a client/server design, you need to design and make API calls to your backend: The backend will provide a response to the frontend (most likely to be the current game states), and then the frontend will update its user interface based on the response. We have no restriction on which frameworks or libraries can be used, but we ask you to use React for at least some of your frontend code.
+
+**Design requirements:** Decouple the user interface from the core game. That is, the core game should not have any dependency on parts of the user interface, where the backend API (e.g., NanoHTTP, Express) is considered as part of the user interface. A simple way to test this is to check that the core implementation compiles and passes tests when all GUI code is deleted.
+
+Decide deliberately what state should be stored in the game and what state is managed by the GUI code; decide deliberately where actions/inputs are validated. Decompose the frontend into cohesive React components/functions.
+
+**Documentation requirements:** In your `README.md` add a section "Starting a Game" that explains how to start the game from the command line (e.g., what sequence of Maven or npm commands do we need to call). Ideally the game's user interface is self-explanatory (e.g., explains what logos mean, has textual instructions on what to do next), but if it is not clear how to play the game for *somebody who knows the rules*, explain this in the README too.
+
+## Milestone 6b: God Cards
+
+Redesign the game to support god cards according to the rules of the game. As described in the rules of the game, each player can pick a god card which modifies possible actions, winning conditions, or other aspects of the game. The game should be designed to be easily extensible for different god cards. This will require that you plan in the base code to make state available to implementations of god cards and allow god cards to change the behavior of the base game. For example, you may want to provide extension points to extend the implementation of what is considered a valid move, to modify what action a player can take next, or to store additional state. In a good extensible implementation of the game, god cards can be implemented with few lines of code each and minimal coupling.
+
+You also need to extend your UI to support users to play with and without God Cards.
+
+**Required god cards:** Implement the following four god cards to demonstrate that your system is extensible: Demeter, Hephaestus, Minotaur, and Pan.
+
+* **Demeter**: Your Worker may build one additional time, but not on the same space.
+* **Hephaestus:** Your Worker may build one additional block (not dome) on top of your first block.
+* **Minotaur**: Your Worker may move into an opponent Worker’s space, if their Worker can be forced one space straight backwards to an unoccupied space at any level.
+* **Pan**: You also win if your Worker moves down two or more levels.
+
+***UI hint for Demeter and Hephaestus***: You will likely need a way to indicate that the player wants to skip the optional second build, e.g., with a "pass" button or by clicking on the worker's current location.
+
+**Design requirement:** In your implementation, the god cards must be entirely decoupled from the base game. The GUI can set up god cards by passing them to the game or wrapping game objects. The base game should not refer to any concepts of specific God cards or store specific state for the god cards. For example, the base game should not use `if (player.hasAtlasGod) (...)` within `Board.isValidMove(...)`. Of course the god cards can interact with the base game, call functions, register callbacks, and so forth.
+
+You should expect that you may need to substantially revise your base game design to make the game extensible. A good initial design will make this easier.
+
+**Design documentation and justification:** Revisit the design documentation and justification from Homework 2 to make the following updates.
+
+* **Update domain analysis:** Extend your domain model, system sequence diagram, and behavior contracts in `domain-model.pdf`, `system-sequence-diagram.pdf`, `contract.pdf` to include the new concept of god cards in the game. To keep things simple, you do not need to show all cards. For these three documents, it is sufficient to just include the god card *Minotaur* as a single concrete example. For the contract you can assume that *the active player has the Minotaur card* and the opposing player has no card.
+* **New justification for extension mechanisms:** Explain in about one paragraph how you redesigned your game to be extensible. In addition, as in Deliverable 5 and 6 of Homework 2, provide a justification with reference to design goals/principles/heuristics/patterns and discuss alternatives you considered and tradeoffs you made. If you used design pattern(s) explain which you used and why you used them, if you did not use any design patterns explain why not. Turn this in as a new `extension-justification.pdf` file.
+* **Updated object model:** Update your object model in `object-model.pdf` to reflect your extension mechanisms and the *Demeter* card.
+* **Update justification for building action:** Extend your discussion in `build-justification.pdf` of how the game validates and performs a build action assuming that *the active player has the Demeter card* and the opposing player has no card. Update both the justification and the object-level interaction diagram.
+
+You do not need to include any GUI-related code in the models. You do not need to update `state-justification.pdf`. We will grade the design documents with a similar rubric to Homework 2, so if you have unaddressed grading feedback, you might want to take this into consideration when refining the documents.
+
+**Testing:** Also update your test suite to test the functionality of the game logic (unit tests), of the god cards (unit tests), and of the game with and without god cards (integration tests). As before, we do not set any specific coverage goals but ask you to use your own judgment about how much testing is useful for you to have confidence in your implementation.
+
+## Submitting your Work
+
+For each milestone, submit a link to your final commit on Canvas as usual in the format `https://github.com/CMU-17-214-Students//commit/`.
+
+For Milestone 6a, make sure that your repository has updated versions of `README.md` in the root directory of your repository. For Milestone 6b, make sure that your repository has the new `extension-justification.pdf` in the root directory of your repository.
+
+## Evaluation
+
+This assignment is worth 300 points, 120 for Milestone 6a and 180 for Milestone 6b.
+
+Homework submissions with a link in the wrong format will not receive any points.
+
+### Milestone 6a user interface (90 points)
+
+* [ ] 10: Separation of GUI and core: The core of the game is independent of the GUI (works with GUI code deleted). Both are separated in different locations of the project. There are no GUI-related concepts (including a backend server providing an API) in the implementation of the core game, and the GUI code does not reimplement the game concepts.
+* [ ] 80: The game is functional, playable through the user interface:
+
+ * [ ] 5: User Interface is clear and easy to use. Users can operate the game basically by clicking their mouse.
+ * [ ] 10: Instructions in the `README.md` file are sufficient to understand how to start and play the game (assuming user knows the rules)
+ * [ ] 5: Game starts and can be restarted (e.g., 'new game' button)
+ * [ ] 5: Both players can place the initial workers (e.g. by clicking an empty grid)
+ * [ ] 5: The GUI indicates the current player
+ * [ ] 10: The GUI indicates available actions (valid move/build actions) or rejects invalid actions
+ * [ ] 5: The game recognizes the end of a turn and moves to the next player
+ * [ ] 15: The game and GUI correctly update after a move action
+ * [ ] 15: The game and GUI correctly update after a build action
+ * [ ] 5: Correctly identifies and shows the winner of the game
+
+### Milestone 6a implementation quality (30 points)
+
+* [ ] 15: Code quality and style: Code meets language's conventions, is reasonably well documented, reasonably clean (e.g., avoids dead code), avoids common programming errors (e.g., == vs equals in Java)
+* [ ] 15: Reasonably cohesive commits and reasonable commit messages
+
+### Milestone 6a bonus points (5 points)
+
+* [ ] 5: The GUI is particularly artistic or attractive
+
+### Milestone 6b god card design and justification (55 points)
+
+* [ ] 10: The implemented design allows god cards to allow additional (optional) actions (e.g., for Demeter and Hephaestus). God cards can be added without changing the implementation of the game's core classes (i.e., no hard coding with if statements).
+* [ ] 10: The implemented design allows god cards to change winning rules (e.g., for Pan). God cards can be added without changing the implementation of the game's core classes (i.e., no hard coding with if statements).
+* [ ] 10: The implemented design must allow god cards to move other workers as part of the current player's actions (e.g., for Minotaur). God cards can be added without changing the implementation of the game's core classes (i.e., no hard coding with if statements).
+* [ ] 10: The implemented design across all models makes reasonable decisions about responsibility assignment, avoids unnecessary coupling, and has reasonable cohesion.
+* [ ] 10: The justification in `extension-justification.pdf` uses suitable design terminology and discusses design alternatives in a meaningful way, demonstrating an engagement with design principles and tradeoffs.
+* [ ] 5: The justification in `extension-justification.pdf` identifies all used design patterns (if any) and justifies their use or why no design patterns were used.
+
+### Milestone 6b design diagrams (notation, consistency, completeness) (40 points)
+
+* [ ] 5: The updated domain model in file `domain-model.pdf` describes the vocabulary of the extended problem with reasonable completeness, uses suitable notation (right UML boxes, named associations with cardinalities, association vs field, reasonable naming), and is at the right level of abstraction.
+* [ ] 5: The updated system sequence diagram in file `system-sequence-diagram.pdf` is reasonably complete, uses suitable notation, and is at the right level of abstraction. It includes the setup for god cards.
+* [ ] 5: The updated behavior contract in file `contract.pdf` is reasonably complete regarding pre- and post-conditions under the assumption that the active player has the *Minotaur* card.
+* [ ] 10: The updated `build-justification.pdf` clearly describes and justifies how build actions are validated and performed. The model describes the behavior for the case where the active player has the Demeter card. We will check:
+ * a. It is clear from the description what checks are performed to determine whether a build action is valid and how the state of the game is updated when the action is performed.
+ * b. The description matches the interaction diagram.
+ * c. The responsibility assignment for each method involved in checking and performing builds is justified with suitable design vocabulary (design goals/principles/heuristics/patterns). The assigned responsibilities and justifications are plausible.
+ * d. The justification demonstrates an engagement with design principles and tradeoffs, and discusses design alternatives in a meaningful way.
+ * e. It is clear how the base game and the *Demeter* god card interact.
+* [ ] 5: The updated interaction diagram in `build-justification.pdf` is reasonably complete, uses suitable notation, is at the right level of abstraction, and is consistent with the object model (called methods exist in target class, caller has access to target objects). The model includes the behavior of the Demeter card for the case where the active player has the Demeter card.
+* [ ] 10: The updated object model in file `object-model.pdf` is reasonably complete, uses suitable notation (right UML boxes, named associations with cardinalities, association vs field, reasonable naming), and is at the right level of abstraction. The updated model also covers the extension mechanisms of the base game and the Demeter card. It is consistent with the system sequence diagram.
+
+### Milestone 6b god card implementation (65 points)
+
+* [ ] 20: The four required god cards are implemented in the game and work as specified.
+* [ ] 20: The game and god cards are tested at a reasonable level. Tests include unit tests of individual functionality and integration test of the game with different god cards. The tests follow good practices (e.g. redundancy, independence, readability).
+* [ ] 10: The implementation is consistent with the design documents.
+* [ ] 15: The user interface supports god cards, including allowing users select god cards and allowing users to control their extra actions (e.g., build again).
+
+### Milestone 6b general implementation quality (20 points)
+
+* [ ] 10: Code quality and style: Code meets language's conventions, is reasonably well documented, reasonably clean (e.g., avoids dead code), avoids common programming errors (e.g., == vs equals in Java)
+* [ ] 10: Reasonably cohesive commits and reasonable commit messages
+
+### Milestone 6b bonus points (0-24 points)
+
+* [ ] 4: points per additional god card listed in the appendix, if it is implemented correctly, not hard-coded in the base game, tested, and usable through the user interface
+
+## Appendix: God Cards
+
+You can find the original rules of Santorini including all god cards at:
+
+We consider only basic god cards. The bold ones are required:
+
+* Apollo: Your Worker may move into an opponent Worker’s space by forcing their Worker to the space yours just vacated.
+
+* Artemis: Your Worker may move one additional time, but not back to its initial space. (UI hint: You will likely need a way to indicate that the player wants to skip the optional second move, either with a "pass" button or by clicking on the worker's current location)
+
+* Athena: During opponent’s turn: If one of your Workers moved up on your last turn, opponent Workers cannot move up this turn.
+
+* Atlas: Your Worker may build a dome at any level. (UI hint: you can implement this in the user interface similar to Hephaestus, giving the player an second optional build action; this build action is interpreted as building a dome)
+
+* **Demeter**: Your Worker may build one additional time, but not on the same space. (UI hint: You will likely need a way to indicate that the player wants to skip the optional second build, e.g., with a "pass" button or by clicking on the worker's current location)
+
+* **Hephaestus**: Your Worker may build one additional block (not dome) on top of your first block. (UI hint: You will likely need a way to indicate that the player wants to skip the optional second build, e.g., with a "pass" button or by clicking on the worker's current location)
+
+* Hermes: If your Workers do not move up or down, they may each move any number of times (even zero), and then either builds. (UI hint: Rather than allowing multiple move actions, it might be easier to indicate all possible target spaces where a worker can move too)
+
+* **Minotaur**: Your Worker may move into an opponent Worker’s space, if their Worker can be forced one space straight backwards to an unoccupied space at any level.
+
+* **Pan**: You also win if your Worker moves down two or more levels.
+
+* Prometheus: If your Worker does not move up, it may build both before and after moving.
diff --git a/previous-labs/figures/vscode-launchconfig.png b/previous-labs/figures/vscode-launchconfig.png
new file mode 100644
index 0000000..91891ab
Binary files /dev/null and b/previous-labs/figures/vscode-launchconfig.png differ
diff --git a/previous-labs/figures/vscode-run.png b/previous-labs/figures/vscode-run.png
new file mode 100644
index 0000000..0ef7c65
Binary files /dev/null and b/previous-labs/figures/vscode-run.png differ
diff --git a/previous-labs/git-basics.md b/previous-labs/git-basics.md
new file mode 100644
index 0000000..f1acb42
--- /dev/null
+++ b/previous-labs/git-basics.md
@@ -0,0 +1,58 @@
+# Git -- The Basics
+
+For all labs and homeworks, you are required to submit your work by pushing changes to your repositories. Throughout the semester you will learn to work with *git* and to use best practices.
+
+Git is a version control system, which is a fancy way to say that you can take *named* snapshots (i.e. make saves) of your code base with it throughout development, and you can easily revert back to any such saves should something go wrong. Sooner or later you will write code that breaks, and you’d wish to “undo” what you wrote. Without git, you’ll have to figure out what you changed and revert them manually, which is time-costly and error-prone. With git, if you made a save when your code was working, you can revert back to that in one command. You also document your work incrementally for others.
+
+## First Steps: Submitting Work
+
+Let's start with the basics on the command line:
+
+````bash
+git add
+git commit -m ""
+git push
+````
+
+**git add** adds files to the staging area, **git commit** saves everything on the staging area along with the given commit message, and **git push** records local commits to the remote repository. After pushing changes you should see them on GitHub.
+
+**Beyond the command line.** You can also push changes to your repository using the VSCode UI or use [GitHub Desktop](https://desktop.github.com/). In VSCode, the source control tab (3rd from the top) provides you with an interface where you can stage, commit, and push changes. Clicking the + icon on the file stages it to be committed. Once you have staged all of your files, you can use the text box to add a commit message and press commit. You can then use the UI to push.
+
+## Important Git Concepts
+
+* **Git Repository:** A git repository is a database of files and their history. On a local computer it will be stored in a .git directory. A repository on your computer is called a *local repository*, and a (typically shared) repository stored somewhere online (e.g. on GitHub) is called a *remote repository*.
+* **Git Commit:** A git commit is a snapshot / save of your git repository. You make a save of your code base by making a git commit. A commit has an ID and a description. It follows another commit. You can later revert back to it.
+* **Working directory:** Code from a git repository can be *checked out* in a directory. This will copy all files from the (typically last) commit from the git database to your directory where you can edit them.
+* **Staging Area:** Before you can make a git commit, you need to specify the files you want to include in your commit. In git you do this by *adding* them to the staging area, where you can double check that you are saving what you want. The *commit* command will create a commit of all files staged, but not of other changed files in your working directory.
+* **Remote Repository:** A remote repository is like a folder on Google Drive. Just like how you could backup your local files online to Google Drive, you can backup your local Git Repository online as a remote repository. This also enables collaboration: remote repositories are usually shared, when your collaborators *push* (upload) new changes to a shared remote repository, you can *fetch* (download) them to your computer.
+* **Branching:** Git branching allows you to create new development paths for your code. Each path is called a branch. Changes on one branch are independent from changes made on a different branch. Later, if desired, changes from different branches can be merged together. People commonly use branching when implementing new features. They create a new “development branch” and implement new code on it, keeping the default “master branch” clean. If the new code works out, they merge changes from the development branch into the master branch. If it doesn’t work out, they just discard the development branch. This ensures that the master branch always contains working code.
+
+![img](https://lh4.googleusercontent.com/dGUCNsOeIKcHSjAEj1XARjgulfXrbndajIB8KfpuJjLvOWFIcEH-Ts6R5bsvViIQf0YxUSBxXtURK0iEmaLh8Zy3BXWHLpgbAWFdpVfG_WAQ6INa3mI_pyzpve0GZLN5FpfK7lPJ0X-ps8ckeqF9JQ)
+
+## Useful Git commands
+
+* `git clone ` (Clone, i.e. download in entirety a git repository from a remote location and check it out in a local working directory)
+* `git pull` (Pull, i.e. download, any new changes from the remote repository not previously downloaded and merge them into your local working directory)
+* `git add ...` (Add files to the staging area)
+* `git status` (Shows which files have been changed and which files are on the staging area)
+* `git commit -m ""` (Make a commit saving everything on the staging area. The save is tagged with a message )
+* `git log` (List all the commits you’ve made)
+* `git push` (Push, i.e. upload, any new commits you made locally to the remote repository)
+* `git branch ""` (Create a new branch named )
+* `git checkout ` (Check out files from the git repository to your local working directory of the branch named )
+
+## Good Git Practices
+
+Good practices help you and other engineers understand your development process. Especially:
+
+* Make clean, single purpose commits.
+* Leave meaningful but concise commit messages.
+* Commit early, commit often
+* Don’t alter published history
+* Don’t commit generated files
+
+## Useful resources to learn git
+
+* [Git cheatsheet](https://education.github.com/git-cheat-sheet-education.pdf) -- A concise guide for git commands
+* [Pro Git book](https://git-scm.com/book/en/v2) -- expert guide to Git written by GitHub founder
+* [Git Game](https://learngitbranching.js.org/?locale=en_US) -- interactive tutorial and playground for practicing branching and merging
diff --git a/previous-labs/images/lab06/lab06_jacoco_report.png b/previous-labs/images/lab06/lab06_jacoco_report.png
new file mode 100644
index 0000000..78b4688
Binary files /dev/null and b/previous-labs/images/lab06/lab06_jacoco_report.png differ
diff --git a/previous-labs/images/lab06/lab06_test_example.png b/previous-labs/images/lab06/lab06_test_example.png
new file mode 100644
index 0000000..1018b20
Binary files /dev/null and b/previous-labs/images/lab06/lab06_test_example.png differ
diff --git a/previous-labs/images/lab06/lab06_test_side_panel.png b/previous-labs/images/lab06/lab06_test_side_panel.png
new file mode 100644
index 0000000..85d1afa
Binary files /dev/null and b/previous-labs/images/lab06/lab06_test_side_panel.png differ
diff --git a/previous-labs/images/lab09/lab09_billing.png b/previous-labs/images/lab09/lab09_billing.png
new file mode 100644
index 0000000..2ea5f83
Binary files /dev/null and b/previous-labs/images/lab09/lab09_billing.png differ
diff --git a/previous-labs/images/lab09/lab09_project_select.png b/previous-labs/images/lab09/lab09_project_select.png
new file mode 100644
index 0000000..5daa8b6
Binary files /dev/null and b/previous-labs/images/lab09/lab09_project_select.png differ
diff --git a/previous-labs/images/lab09/lab09_view_all_products.png b/previous-labs/images/lab09/lab09_view_all_products.png
new file mode 100644
index 0000000..6b3f5d2
Binary files /dev/null and b/previous-labs/images/lab09/lab09_view_all_products.png differ
diff --git a/previous-labs/images/lab11/component.png b/previous-labs/images/lab11/component.png
new file mode 100644
index 0000000..d11f483
Binary files /dev/null and b/previous-labs/images/lab11/component.png differ
diff --git a/previous-labs/images/lab11/jsonFormat.png b/previous-labs/images/lab11/jsonFormat.png
new file mode 100644
index 0000000..366391b
Binary files /dev/null and b/previous-labs/images/lab11/jsonFormat.png differ
diff --git a/previous-labs/images/lab11/proxy.png b/previous-labs/images/lab11/proxy.png
new file mode 100644
index 0000000..2c51f57
Binary files /dev/null and b/previous-labs/images/lab11/proxy.png differ
diff --git a/previous-labs/images/lab11/proxy2.png b/previous-labs/images/lab11/proxy2.png
new file mode 100644
index 0000000..ef37068
Binary files /dev/null and b/previous-labs/images/lab11/proxy2.png differ
diff --git a/previous-labs/images/lab11/tictactoe.png b/previous-labs/images/lab11/tictactoe.png
new file mode 100644
index 0000000..48dfc2a
Binary files /dev/null and b/previous-labs/images/lab11/tictactoe.png differ
diff --git a/previous-labs/lab01.md b/previous-labs/lab01.md
new file mode 100644
index 0000000..70f10b5
--- /dev/null
+++ b/previous-labs/lab01.md
@@ -0,0 +1,162 @@
+# Lab 1: Course Infrastructure Setup
+
+During this course, you will become familiar with several popular and industry-relevant software engineering tools, including an IDE, build systems, and automated style checkers for both Java and TypeScript. In this lab, you will set up your environment and explore some tools for getting started with TypeScript. The instructions are unusually long, because we try to provide more detailed help for common problems. If you encounter problems along the way, look back at the instructions, work through problems with others, and seek help from the TAs during the lab session.
+
+## Deliverables
+
+* [ ] Locally clone your 214 Git repository, fix a typo in the `README.md` file ("assigment" -> "assignment") and commit and push the change.
+* [ ] Install node.js, TypeScript, and an editor/IDE of your choice (we recommend Visual Studio Code). Show that you can compile and run the TypeScript starter code of homework 1 on your machine.
+* [ ] Install Java 21, Maven, and an IDE of your choice. Run `java --version` to verify it is version 21. Show that you can compile and run the Java starter code of homework 1 on your machine.
+
+## Setting Up Your Repo
+
+In this lab, we will work with the starter code from homework 1. Each student in 17-214/514 is assigned a GitHub repo per homework assignment. You can create it by following the GitHub Classroom link in the description of [Homework 1 on Canvas](https://canvas.cmu.edu/courses/40772/assignments/715057).
+
+* If you do not have *git* yet, follow the [download instructions](https://git-scm.com/downloads).
+* If you do not have a *GitHub* account yet, [create one](https://github.com/).
+* Follow the GitHub classroom link on Canvas/Piazza to create your own GitHub repository with the starter code for homework 1.
+
+**Setting up your Personal Access Token.** Before cloning the repository, you should set up your own personal access token; otherwise, you might get an invalid username or password error. GitHub removes these every year, so even if you have made one in the past, you may need to recreate it. You can follow the [instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for the general outline on how and where to create a personal access token. Some things to note:
+
+* You can name it something like 17214f24 or whatever you’d like
+* Set the expiration date to be some time past the end of the semester (e.g. 12/21/25), so that you don’t have to remake it again this semester
+* You can select all of the options if you’d like and read more about what they do [here](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps). At the very least, make sure you have the **repo, workflow, user, project** scopes selected.
+* **Important:** Once you generate the token, make sure you save it somewhere safe and accessible to you before you leave the page. You will need to use it as your password to log-in and you won’t be able to see it again after leaving the page.
+
+**Cloning the Repository.** Navigate to your own remote repository, and then click on the green “code” button to copy the URL of this remote repository so that you can clone it.
+
+We recommend to learn to use *git* on the command line, but you can also the integration in your IDE or [GitHub Desktop](https://desktop.github.com/). To clone the repository from the command line run the following in a terminal: `git clone `
+
+This will download the entire repository to your computer. If you are prompted to input your username and password, make sure that you use your personal access token you created above as the password.
+
+## TypeScript Tools
+
+To run JavaScript applications outside the browser we use Node.js. We write TypeScript code that gets compiled into JavaScript.
+
+### Installing Node.js, npm, and TypeScript
+
+Follow [instructions](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to install Node.js on your system. We recommend you install it through [nvm](https://github.com/nvm-sh/nvm). If you’re working on a Windows machine, we recommend using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) for installing nvm (and subsequently using WSL for all development in this class).
+
+The following command will automatically download the installation script and update your environment to install it: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash` Verify it installed correctly by running:
+
+`command -v nvm`, which should output nvm.
+
+With nvm installed, you can then install Node.js. Run the command `nvm install node` which should install the latest version of node. Then, run `nvm install-latest-npm` which should install the latest version of npm supported by the node version you installed.
+
+**Package management with npm.** We are using npm for package management:
+
+* The `package.json` file is the configuration file, which lists dependencies and commands
+* `npm install` installs all dependencies and puts them in a local directory `node_modules`, which should *not* be committed to version control and is automatically in the search path for imports from JS/TS code
+* The `package.json` file has a `dev-dependencies` section, which are development tools not needed at runtime, such as test execution, compilers, and style checkers.
+* `npm install -g X` installs package X globally, so not just for the current directory. This is often useful for tools like TypeScript that are installed through npm. `npx` is a useful tool for executing a tool installed locally and hence not otherwise in the path, like `npx tsc`.
+* The `package.json` file has a `scripts` section, which is just a way to describe command line instructions that can be easily run with `npm run X` from the command line. These are just convenient shorthands.
+
+*Checkpoint:* Run `npm install` to install dependencies and tools locally. You can find them in the `node_modules` folder if you are interested.
+
+**Installing TypeScript.** To install TypeScript run `npm install -g typescript` and afterward `tsc` should be available on your command line. (The project we provide already sets up TypeScript, so `npm install` should already install TypeScript locally).
+
+*Checkpoint:* Confirm that `tsc --version` works in your working directory (or `npx tsc --version` if you installed it only locally).
+
+Run `tsc` to compile the TypeScript code. You can find the output in the dist/ directory.
+
+### VSCode for TypeScript
+
+VSCode is a popular IDE for TypeScript which we recommend for this course. It works for TypeScript out of the box, no further set up needed.
+
+Install VSCode following [instructions](https://code.visualstudio.com/) on its homepage or use your operating system's package manager.
+
+*Checkpoint:* You can explore the source files of the cloned repository in the IDE.
+
+**Running a Program in VSCode.** VSCode executes code in the debugger by default. Select “Start debugging” from the menu and confirm to use node.js as the runtime. Note that the program will fail because the debugger does not support command line input, but everything until this part will execute.
+
+If you just want to run the code use a terminal or the built-in terminal in VSCode (“New Terminal”) and run `node dist/index.js` to start the compiled program (or `npm run start` for the preconfigured run script in package.json)
+
+### Style checking with ts-standard
+
+Linters check your code against a style-guide that specifies some good coding conventions (and sometimes annoying nitpicky things). Linters automates the process of checking for common style flaws such as the use of magic numbers. We preconfigured the project with the (very picky) style checker *ts-standard*. It comes preconfigured in the project with `npm run lint` or just run it with `npx ts-standard` (or just `ts-standard` if you installed the package globally). It has a fix option `npx ts-standard --fix` that will automatically fix many issues, which can be very useful. To integrate ts-standard into vscode, install the *StandardJS* extension and in the settings pick ts-standard as the engine.
+
+*Checkpoint:* Install and configure the StandardJS extension. Introduce some style violation to see what it reports (like extra or missing whitespace). Try to fix it automatically with “npx ts-standard --fix”.
+
+## Java Setup
+
+### Installing Java
+
+Download and install Java 21. The language used in this class is Java 21. Several vendors provide implementations of Java 21, if in doubt choose the open-source OpenJDK 21.
+
+Installing the right version of Java can sometimes be a bit tricky. If you already use a package manager for your platform (homebrew, apt, snap, scoop, etc) installing Java with that tool is probably the easiest. Below are detailed instructions, but feel free to skim/skip.
+
+*Note for Windows users:* We recommend installing [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) (Windows Subsystem for Linux) and using it for all your development environments installations and future assignments when following this guide.
+
+**Installing Java using homebrew on MacOS.** Run `brew install openjdk@21` and run the command from the output to create a symbolic link. See [these instructions](https://medium.com/@manvendrapsingh/installing-many-jdk-versions-on-macos-dfc177bc8c2b) for a detailed reference.
+
+**Manual installation and other operating systems.**
+
+* MacOS. Download the MacOS tar.gz archive from the [OpenJDK website](https://jdk.java.net/archive/). Untar the archive (double click), and move the contained directory (named something like jdk-21.0.4.jdk) to the /Library/Java/JavaVirtualMachines/ directory
+* Linux. If possible, please really use the package manager of your distribution. It will be much easier. Instructions for a manual installation on Ubuntu can be found [here](https://computingforgeeks.com/install-java-jdk-21-openjdk-21-on-ubuntu/).
+* Windows. To install OpenJDK, download the Windows zip file from the [OpenJDK website](https://jdk.java.net/java-se-ri/21), and follow the instructions at [this StackOverflow post](https://stackoverflow.com/questions/52511778/how-to-install-openjdk-11-on-windows/52531093#52531093) to correctly set Windows environment variables. Alternatively, if you wish to just use an install wizard, [download and install the Oracle JDK](https://www.oracle.com/java/technologies/downloads/#java21).
+
+**Managing multiple Java installations.** If you already have existing different versions of Java installed and want to keep them, you can use [jEnv](http://jenv.be) to help manage your installations. As another option, you can set the JAVA_HOME environment variable in your ~/.zshrc or ~/.bash_profile or Windows configuration to point to Java 21 folder (e.g., `export JAVA_HOME=$(/usr/libexec/java_home -v21)`; if you choose this approach, you’ll need to modify the number that comes after -v if you ever want to switch your Java version). If you’re interested in switching between Java versions (not needed in this course), see [here](https://medium.com/@manvendrapsingh/installing-many-jdk-versions-on-macos-dfc177bc8c2b) under the section “Switching JDKs” for instructions on how to do so.
+
+*Checkpoint:* Confirm your Java installation by inspecting the output of the command `java -version` and `javac -version`. You should see something similar to: *openjdk version "21.0.4" 2024-07-16.* The major version should be 21, any vendor and patch version is okay.
+
+### Installing Maven
+
+We use Maven as the build tool and package manager for Java in this course. Install a recent version of Maven. You can follow the instructions in [this link](https://www.baeldung.com/install-maven-on-windows-linux-mac) and verify that Maven 3.8.7 or newer is installed.[^1] More information about Maven can be found [here](https://maven.apache.org/what-is-maven.html).
+
+For Mac users, you might find it easiest to install maven using homebrew: `brew install maven`
+
+Explore the `pom.xml` file to see how the project is currently configured.
+
+*Checkpoint:* In your local directory, try to run `mvn install` which will download dependencies and compile the code. You can either type `mvn install` in the terminal or click the Maven tab on the bottom left, scroll down to “install” and press the triangle.
+
+### VSCode for Java
+
+VSCode supports also Java. We recommend VSCode for development in both Java and TypeScript, but you are free to chose others. While IntelliJ and Eclipse are more advanced if you are solely developing in Java, using VSCode for both will save you from having to switch between IDEs which can be tedious.
+
+**Navigate to the sidebar and look for the extensions symbol (5th from the top) and search for “Extension Pack for Java” and install it locally**. This extension includes linting, test running and debugging, support for Maven (the build automation tool we use for Java projects in this class), and a few other helpful extensions.
+
+You need to have Java 21 installed for this project. Do not downgrade your Java version if you are asked to, this will break your project.
+
+*Checkpoint:* You can explore the source files in the IDE.
+
+**Running a Java program in VSCode.** Once you have successfully opened the project and installed Maven, you should be able to view all the starter source files. Try building the program and run the main class.
+
+![img](figures/vscode-run.png)
+
+To run a program go to the Main class (`Main.java`), you should see a *Run | Debug* prompt above the main method. Click *Run*. You will be able to view the run result at the bottom. You can interact with this program by replying on the console and hitting “enter”.
+
+Alternatively, you can open the `Main.java` file and then open the *Run and Debug* tab on the left sidebar (4th from the top). Pressing Run and Debug will have the same effect as pressing Debug on the prompt above the main method.
+
+**Passing a command-line argument (you might find this helpful for HW1).** If you want to pass an argument to the program from within VSCode, click *“Create a launch.json file”*. This will open a file containing all of the run configurations. If you’d like to modify this in the future, you can find it in the .vscode folder.
+
+![img](figures/vscode-launchconfig.png)
+
+Under the configuration named `Launch Main`, you can add the attribute `args` and supply it with your arguments. For example `"args": "--help"`. You can also supply multiple arguments in the same line: `"args": ["--arg1", "value1", "--arg2", "value2", …]`
+
+For more information on launch configurations and Java debugging in VSCode, see [here](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations).
+
+### Checkstyle for Java
+
+We preconfigured the project with the style checker *CheckStyle*. It is automatically executed as part of compiling and packaging the project with `mvn site (on the command line or in the IDE).
+
+If you’d like to be able to run checkstyle through VSCode’s UI, you can search for and install the [“Checkstyle for Java” extension](https://code.visualstudio.com/docs/java/java-linting#_checkstyle). To use this extension: Right click the `checkstyle.xml` file and select *“Set the Checkstyle Configuration File”* . Then right click on the file you want to check and select *“Check Code with Checkstyle”*. You can view the checkstyle violations on the problems tab near your terminal.
+
+*Checkpoint*: Test Checkstyle by renaming one method to start with a capital letter (against Java's style guidelines) and it should complain. A neat thing that this plugin does is automatically lint your code as you write it. You can test this out by opening the “problems” tab and making further changes.
+
+## Turning in Your Work
+
+For finishing this lab (and all homeworks), you are required to submit your work by pushing changes to your repositories on GitHub.
+
+The minimal instructions to submit code with Git on the command line are:
+
+````bash
+git add
+git commit -m ""
+git push
+````
+
+**git add** adds files to the staging area, **git commit** saves everything on the staging area along with the given commit message, and **git push** records local commits to the remote repository. After pushing changes you should see them on GitHub.
+
+If you are new to Git you will learn to better use it throughout the semester, including best practices and more advanced functionality like branches. We provide more detailed instructions in a [separate document](git-basics.md) but encourage you to find documentation and tutorials on your own too.
+
+[^1]: If you choose to use the instructions linked, the `chown -R root:wheel Downloads/apache-maven*` command should actually be `sudo chown -R root:wheel Downloads/apache-maven*`. If you run into issues with adding Maven to your environment path, try using `~/.zshrc` instead of `~/.zshenv`.
diff --git a/previous-labs/lab02.md b/previous-labs/lab02.md
new file mode 100644
index 0000000..93b126b
--- /dev/null
+++ b/previous-labs/lab02.md
@@ -0,0 +1,43 @@
+# Lab 2: Encapsulation
+
+In this lab you will get familiar with core language features for encapsulation in Java and TypeScript and practice with encapsulation and information hiding.
+
+## Deliverables
+
+- [ ] Rewrite the Java implementation to improve encapsulation. The code (a) should program against an interface where possible, (b) should hide all implementation details with language mechanisms, and (c) should still be runnable.
+- [ ] Rewrite the TypeScript implementation to improve encapsulation. The code (a) should program against an interface where possible, (b) should hide all implementation details with language mechanisms, and (c) should still be runnable.
+- [ ] Demonstrate your understanding of good commit practices with the commits solving this encapsulation task.
+
+## Good Git Practices
+
+Recall good practices for git and commit messages from the lecture. Good practices help you and other engineers understand your development process. Especially:
+
+- Make clean, single purpose commits
+- Leave meaningful but concise commit messages
+- Commit early, commit often
+- Don’t alter published history
+- Don’t commit generated files
+
+Demonstrate those practices with all commits you do in this lab and also in all future homework assignments.
+
+## Improving Encapsulation
+
+Fork and clone this repository:
+
+This repository contains equivalent starter code in both Java and TypeScript. You will complete this task in both languages.
+
+First, get familiar with the source code. Find the entry point, follow imports, and understand classes/types used. Run the code (recall Recitation 1 for instructions). Generally the code is structured as follows:
+
+- The `shapes/` folder contains the Shape interface and several implementing classes.
+- A `Renderer` class takes a `Rectangle` object and provides a `draw` method.
+- `Main.java` or `index.ts` creates a `Renderer` backed by a `Rectangle` and calls `draw()` on it.
+
+Second, look for problems—no code is perfect, even if it works. In this case, we are looking for issues related to encapsulation & information hiding. Check whether any code is either accessing or depending on information that is not essential to its functioning. To put it differently, could the code be made to work while assuming access to fewer implementation details. *Hints: What type of Shape does a Renderer actually need, in the real world? Does the implementation depend on something more specific, for instance by accessing information it shouldn’t rely on?*
+
+Third, rewrite the code to improve encapsulation and information hiding. Here are some suggestions:
+
+1. First, consider what a better design of the shapes/ package would look like: What would a common interface for a shape look like?
+2. Once you introduce the proper interface, you can make the changes to the implementing classes to both (a) implement that interface precisely, and (b) hide *all* information that is not part of the interface.
+3. Finally, find all *uses* of shapes and ensure that they depend only on the interface and not on any internals. Also think about *declaring types:* if you’ve made all the changes correctly, your main function no longer needs to provide Rectangle to Renderer, so it should declare the shapes as Shapes, even if they are *instantiated* as something more specific.
+
+Finally, commit your solutions (in both languages) using good commit practices (see our [Git instructions](git-basics.md) if needed).
diff --git a/previous-labs/lab03.md b/previous-labs/lab03.md
new file mode 100644
index 0000000..5b7825b
--- /dev/null
+++ b/previous-labs/lab03.md
@@ -0,0 +1,75 @@
+# Lab 3: Inheritance and Delegation
+
+## Concepts
+**Inheritance vs Delegation:**
++ Inheritance: Allow one class (Child class) inherits attributes and behaviors from another class (Parent class), promoting code reusability.
++ Delegation: One class delegates duties to another class which reduces coupling.
+
+## Deliverables
+- [ ] Create a subclass of SortedIntList with inheritance that counts how many elements have been added to the list.
+- [ ] Create a class to extend SortedIntList with delegation to count how many elements have been added to the list.
+- [ ] Discuss questions regarding the tradeoffs and limitations between inheritance and delegation with a TA (no written answer needed).
+
+## Instructions
+
+### Setup
+Fork and clone the repo from [https://github.com/CMU-17-214/f24-lab03](https://github.com/CMU-17-214/f24-lab03.git)
+
+The repo has both Java and Typescript codes so feel free to implement in either of the languages you feel comfortable. Please try out the other language in your own time to gain an understanding of inheritance & delegation in both languages.
+
+## Task Overview
+You will examine the strengths and weaknesses of inheritance and delegation by using both techniques to add a feature to a ```SortedIntList``` class. The ```SortedIntList``` class is one of a family of integer lists. It is very similar to the ```AbstractIntList```, except it stores its elements in ascending order.
+
+We want to instrument a ```SortedIntList``` to count how many elements have been added since it was created. (This is not the same as its current size, which is reduced when an element is removed). To provide this functionality ```getTotalAdded```, you should count the number of attempted insertions and also provide an access method to get this count. Your solutions should use inheritance and delegation so you can reuse, but not modify, the original ```SortedIntList``` implementation. Please refer to the appendix for the UML diagram.
+
+
+### Task 1: Instrumentation with inheritance
+We have provided an empty ```InheritanceSortedIntList``` class where you should implement an inheritance-based solution.
+
+> Hints:
+> + ```InheritanceSortedIntList``` should extend ```SortedIntList```.
+> + The ```SortedIntList``` contains two methods that add elements, ```add``` and ```addAll```.
+> + You should override both of these methods to track how many elements have been added.
+> + Make sure you check that ```getTotalAdded``` works with both ```add``` and ```addAll```.
+
+After you have implemented the ```InheritanceSortedIntList``` class, test the instrumentation you just added using tests in ```InheritanceSortedIntListTest``` class.
+
+### Task 2: Instrumentation with delegation:
+We have provided an empty ```DelegationSortedIntList``` class where you should implement your delegation-based solution.
+
+> Hints:
+> + Ensure your class implements the ```IntegerList``` interface.
+> + Create a private ```SortedIntList``` instance for delegation.
+> + Delegate list operations to the ```SortedIntList``` instance.
+> + Make sure you check that ```getTotalAdded``` works with both ```add``` and ```addAll```.
+> + After you have implemented the ```DelegationSortedIntList``` class, test the instrumentation you just added using tests in ```DelegationSortedIntListTest``` class.
+
+
+Run the tests and make sure your instrumentation passes all the tests.
+(You might want to use the ```printList``` helper we provided you and read the documentation for ```addAll``` in the ```AbstractIntList``` class.)
+
+### Task 3: Questions on Delegation and Inheritance
+Evaluate your two implementations for the given problem and answer the following questions:
+1. Which is more dependent on the implementation details of the ```SortedIntList```, delegation or inheritance?
+2. If the ```add``` method in ```SortedIntList``` is significantly modified or its behavior changes, which implementation is more likely to break?
+3. What issues does using delegation solve that might have been problematic with inheritance?
+4. Based on the provided implementations, when would it be more appropriate to use inheritance and when to use delegation?
+
+
+## Appendix
+Take a look at the UML diagram to see what each function should implement.
+![Rec05_UML](https://github.com/user-attachments/assets/d9ee7c69-81cf-4604-be85-baf1d72bdac4)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/previous-labs/lab04.md b/previous-labs/lab04.md
new file mode 100644
index 0000000..1d13d1b
--- /dev/null
+++ b/previous-labs/lab04.md
@@ -0,0 +1,56 @@
+# Lab 4: Software Design and UML
+
+During lecture, we discussed how we analyze problems, design solutions, and communicate them via UML diagrams. In this lab, you will practice creating UML diagrams for a hypothetical implementation of Blackjack. We encourage you to review the lecture notes, reference [UML and Patterns](https://cmu.primo.exlibrisgroup.com/discovery/fulldisplay?context=L&vid=01CMU_INST:01CMU&search_scope=MyInst_and_CI&tab=Everything&docid=alma991019576227704436) (Chapter 9-10, 14-15), and work with each other. You are free to draw the diagrams via paper and pencil, tablet, or whatever you choose as long as the diagrams are legible. We recommend [https://www.draw.io](https://www.draw.io).
+
+## Deliverables
+
+- [ ] Create a domain model for Blackjack as described below, and develop a system sequence diagram depicting a single player starting a new game and playing one round of Blackjack.
+- [ ] Find and fix two problems with coupling/cohesion in the provided object model.
+- [ ] Create an object-level interaction diagram for a player choosing to hit in a round of Blackjack, consistent with your fixed object model and system sequence diagram.
+
+## Instructions
+
+### Background
+
+Suppose you are designing and implementing a simplified version of Blackjack, where up to 9 players plays against an automated dealer.
+Here is a short description of the game:
+
+ The objective of Blackjack is to obtain a score higher than the dealer. In each round the **players** and the **dealer** are initially dealt 2 **cards**, with one of the dealer’s cards dealt face down. Each numerical card (2-9) is worth its **face value**, aces are worth either 1 or 11 (it is the player’s choice), and all face cards (ten, jack, queen, and king) are worth 10.
+
+ At the beginning of each round each player must place a **_bet_**; this amount will not change for the rest of the round. After the bet, the first player repeatedly decides whether to **hit** (be dealt a new card, up to 5 cards in the player’s hand) or **stand** (stop being dealt cards). If the player **scores** more than 21 points, the player loses their bet.
+
+ After the player stands, the next player takes their turn until all players have either stood or lost. Then, the dealer exposes their face-down card and must hit (be dealt cards) until the value of their cards is more than 16. If a _player’s score_ is more than the dealer’s final score (but less than or equal to 21) then the player wins an amount equal to their bet. A player also wins if they are dealt 5 cards worth 21 or fewer points.
+
+ Otherwise, the player loses their bet. More information can be found on Wikipedia’sBlackjack page.
+
+### Domain Model
+
+Build a vocabulary by creating a _domain model_ for this problem. Document all relevant concepts and include important attributes and associations. (Remember, a domain model is used to analyze the problem; it describes concepts and abstractions of the real world, not software classes.)
+
+### System Sequence Diagram
+
+A _system sequence diagram_ is a model that shows, for one scenario of use, the sequence of events that occur between users(actors) and the system itself.
+
+A system sequence diagram should specify and show the following:
+
+ 1. External actors
+ 2. Messages (methods) invoked by these actors
+ 3. Return values (if any) associated with previous messages
+ 4. Indication of any loops or iteration area
+
+Create a _system sequence diagram_ to model the interactions of a single player starting a new game and playing one round of Blackjack. To start designing a solution, think about how the game flows from an initial action (e.g., a user clicking a button, or part of the system requesting some information) to the individual steps following that action. Carefully consider all the interactions a player can make with the system (e.g., the player takes a hit or the player makes a bet). Note, that a system sequence diagram **does not** include internals of how the system responds to user requests.
+
+### Object Model
+
+Review the proposed object model for Blackjack: [https://drive.google.com/file/d/1XlAhszdys8pGbY4KSNXUnqZS9hw5LIm_/view?usp=sharing](https://drive.google.com/file/d/1XlAhszdys8pGbY4KSNXUnqZS9hw5LIm_/view?usp=sharing).
+![lab04-object-model-problem](images/lab04/blackjack_object_problem.jpg)
+
+There are several poor design choices, involving low cohesion and high coupling. Find and correct two of these design problems on the object model.
+
+### Interaction Diagram
+
+To start designing a solution, consider the scenario of:
+
+- During the game, a player decides to take the ‘hit’ action, which includes dealing an additional card, checking whether the player’s turn is over, etc.
+
+Create an _interaction diagram_ (using a UML sequence diagram) that models the **interaction among objects** in this scenario. Your diagram should include specific classes and methods in your **object model**. As you map out the interactions, consider how they might look different had you made different design decisions. Note: To help distinguish this artifact from system sequence diagrams, we sometimes call this an **object-level interaction diagram**.
diff --git a/previous-labs/lab05.md b/previous-labs/lab05.md
new file mode 100644
index 0000000..418d949
--- /dev/null
+++ b/previous-labs/lab05.md
@@ -0,0 +1,74 @@
+# Lab 5: Refactoring and Anti-Patterns
+
+## Introduction
+A lot of the design principles and heuristics we have discussed in this class are there to encourage good design *up-front*. But you do not always have control over how a system you are using gets created.
+
+
+**Anti-patterns** are common examples of bad design. They tend to come about due to a program’s natural evolution, coupled with poor choices early on, which leads to code that is increasingly *tangled*, badly coupled, low on cohesion, etc. These are often signaled by **code smells** -- heuristic, but not guaranteed indicators of anti-patterns, like overly long methods, or a class that calls a lot of another class’ code (feature envy, signals high coupling).
+
+In this lab, you will become a refactoring agent who detects anti-patterns and poor design decisions within the code, and attempts to fix them.
+## Deliverables
+
+- [ ] Identify one design problem with Frogger crossing the road (in Frogger.java and Road.java). Explain the design problem to the TA and show an improved implementation that fixes the design problem.
+- [ ] Identify one design problem with Frogger recording themselves (in Frogger.java and Records.java). Explain the design problem to the TA and show an improved implementation that fixes the design problem.
+- [ ] Identify at least two issues (no need to name the anti-pattern) associated with the Drawing System, and explain how you would refactor it to the TA. No coding required.
+
+## Instructions
+
+### Setup
+Fork and clone the repo from [https://github.com/CMU-17-214/f24-lab05](https://github.com/CMU-17-214/f24-lab05).
+The task is provided in Java. If you would like some additional exercise, feel free to look into the "accounts" folder and identify the anti-pattern associated with it.
+
+In the appendix, we have provided a non-comprehensive list of anti-patterns. You might want to read and refer to when doing the tasks.
+
+### Task 1
+Frogger is trying to cross the road, which she holds as a "Road" object in her fields. The Road object holds a boolean array indicating which steps are “occupied”; Frogger is on a specific square (“position”) and provides a move method (either forward or backward).
+
+In the frogger folder, navigate to the Frogger.java and Road.java classes and take a look at the code. What is it doing and which anti-pattern is present? Try to fix the design by modifying the two classes.
+
+> Hint:
+> + What information should Frogger hold? Does it do things that appear unusual for a Frogger?
+
+
+### Task 2
+
+Frogger crossed the road and remembered: she was here to *record* her identity status at the Frogger Office. This is held in the "Records" object in her field. Frogger tries to fill in the fields according to the Record object. But there are simply too many things to fill in.
+
+Take a look at Records.java and then Frogger.java (again). What anti-pattern is present? Then try to fix the design by modifying the two classes. Alternatively, take a look at FroggerID.java. How might you use it?
+
+### Task 3
+
+Next, let's study the “drawing” system. Open the drawing folder--and start by reading Drawing.java. There seem to be several design problems involved: think through them. For each of the poor design decisions below, think about how you would refactor them (no need to write actual code), and explain two of these refactorings to your TA. (The entire folder contains more design problems than the ones we've described below. If you would some additional practice, feel free to explore!)
+
+1. The "draw" function seems to duplicate itself. How would you refactor it so that we don't need to rewrite the functionality everytime we introduce a new file type?
+2. Take a look at ``` Drawing.java ```. Somewhere inside the "draw" function, the code seems to be explicitly creating an array of Lines and feeding it to the shape. How would you refactor it so that we don't need to expose and rely on such information inside our Drawing class?
+
+
+## Appendix
+
+Below are a few anti-patterns/code smells, together with a brief explanation and possible refactoring actions. This list is not meant to be a comprehensive: it only includes several common examples. You don’t need to memorize this list. Instead, try to learn to recognize these patterns using the examples provided. You should also be able to discover new ones using the resources pointed to.
+
+1. **Feature envy**: this antipattern happens when one class uses a lot of another’s functionality. This strongly indicates that some of the work being done in the former belongs in the latter (information expert).
+ - Refactoring: move methods/fields, possibly part or some of them, to the information expert. This might work for inappropriate intimacy (below), but if both classes really need the same fields, create a delegate that can be used by both instead.
+ - Related: **inappropriate intimacy**, where one class relies too much on the implementation details (fields, protected methods) of another.
+
+2. **Large (“god”) class**: one class that has many responsibilities (poor cohesion).
+ - Refactoring: extract classes to delegate to, sub-class if you need inheritance. It can also help to extract an interface, by identifying important components.
+ - Related: **middle man**, where one class only exists to delegate work elsewhere. This smell applies to classes that don’t do any actual work, and can also show up in small classes.
+
+3. **Message chains**: one method makes a series of calls on the return values of another. Think of the CardDeck → FlashCard.getStatus() → CardStatus.getSuccesses example.
+ - Refactoring: create a delegate method in the intermediate class (e.g. ‘getSuccesses’ on ‘FlashCard’).
+
+4. **Shotgun Surgery**: making any change requires changing a lot of code (bad responsibility assignment).
+
+5. **Long method**: a method does too many things at once.
+ - Refactoring: extract any cohesive parts to separate methods.
+
+6. **Long parameter list**: a long list of parameters provided to a method.
+ - Refactoring: identify an object that already holds all or most of these parameters, or create a “parameter Object” to pass instead. If this does not apply, identify if any parameters require a method call to compute on the caller’s side and move that method call into the method.
+
+7. **Refused bequest**: two classes are connected through inheritance despite rather limited similarities (excessive coupling).
+ - Refactoring: either restructure the hierarchy to a much simpler superclass object (if inheritance is really appropriate), or (more commonly) extract a delegate for the shared functionality.
+
+8. **Excessive Instanceof**: a function uses multiple "instanceOf" calls to determine the type of the object it is interacting with. This is bad encapsulation and hard to extend.
+ - Refactoring: restructure the code by invoking a more general class or interface that the subclasses may program against.
diff --git a/previous-labs/lab06.md b/previous-labs/lab06.md
new file mode 100644
index 0000000..0e1ed62
--- /dev/null
+++ b/previous-labs/lab06.md
@@ -0,0 +1,57 @@
+# Lab 6: Testing
+
+In this lab you will get familiar with different testing strategies and practice writing good unit tests in Java.
+
+## Concepts
+
+**Structural testing vs Specification testing:** Two distinct types of unit testing are specification-based (historically: black-box) testing and structural (white-box) testing. Specification testing is when you write high-level test cases against the specification of a program, without using (or testing) the underlying implementation of the program. In structural testing, your tests are instead tailored to the specific underlying implementation of the code you are testing.
+
+**Code coverage:** Coverage is the amount of code that has been executed by the tests. There are several coverage metrics, but one common metric line coverage is simply the percentage of lines (or statements) that have been executed by your unit tests.
+
+## Deliverables
+
+- [ ] Using specification testing, write tests for the `LinkedIntQueue` class, then execute them from within the IDE.
+- [ ] Use the above tests to find bugs in the `ArrayIntQueue` class.
+- [ ] Add tests to achieve 100% line coverage for the `ArrayIntQueue` class, and show coverage results in the IDE or as an HTML report.
+- [ ] Describe your experience with the tradeoffs between structural testing and specification testing to your TA. (No written answer is needed.)
+
+## Instructions
+
+### Setup
+
+Fork and clone the repo from https://github.com/CMU-17-214/f24-lab06.
+The code is set up with JUnit. You can use your IDE to open the folder of Java and run the existing tests with the command in the readme.md. You can also see Appendix 1 for how to run tests in your IDE.
+
+### Testing
+
+For the `LinkedIntQueue` class, use specification testing by refering to the `IntQueue` specification in `IntQueue.java`.
+Write additional tests and execute them from within the IDE.
+
+For the `ArrayIntQueue` class, use structural testing. Specifically test the underlying implementation of the `ArrayIntQueue` class, not just test against the `IntQueue` specification.
+
+1. Open the Java folder with your IDE. Run the `IntQueueTest` class in the IDE (see REAME.md). Change the `mQueue` variable to `ArrayIntQueue` and run the tests again. Use your IDE to see the line coverage result. See appendix 3 for coverage tooling.
+2. Try to find two bugs in `ArrayIntQueue` by running your tests. Fix each bug that was found.
+3. Write more test cases to achieve 100% line coverage.
+
+## Appendix 1: Test Integration in VSCode
+
+The `Test Runner for Java` plugin in VSCode provides great test integration functionality. The testing side panel shows all the tests of the current project. You can also run all tests or a particular test here.
+
+![lab06_test_side_panel](images/lab06/lab06_test_side_panel.png)
+
+After running the test cases, the plugin also shows the failed test cases. Also, you can direct to the failed assertions, and VSCode can show the concrete reasons for the failures.
+
+![lab06_test_example](images/lab06/lab06_test_example.png)
+
+## Appendix 2: Test Directories For Java
+
+By convention in Maven, test files are placed in a test folder with the path `src/test/java`. You may need to create this directory if it does not exist. (This is useful for homework 3.) In some IDEs, you may need to indicate that this directory contains test files for the IDE to recognize and run the classes. In this directory create the same package structure as in `src/main/java` and place the test class in the same package as the class to be tested.
+
+## Appendix 3: Coverage Tools
+
+In Java, we already set up the project to use Jacoco for collecting coverage information. If you run `mvn test` or `mvn site` to execute the tests, it will produce a report in `target/site/jacoco/index.html`. You can check the pom.xml file to see how we enabled this. Open with a browser to view the coverage report.
+
+Your jacoco report should be similar to this when viewed in the browser.
+![lab06_jacoco_report](images/lab06/lab06_jacoco_report.png)
+
+In VSCode you can run tests with Coverage directly from within your IDE: Right click on test class and select **Run '$classname' with Coverage**; there should be a panel that pops up the right side of the screen showing class coverage.
diff --git a/previous-labs/lab07.md b/previous-labs/lab07.md
new file mode 100644
index 0000000..056def3
--- /dev/null
+++ b/previous-labs/lab07.md
@@ -0,0 +1,85 @@
+# Lab 7 - Test Double
+
+This lab is an introduction to test doubles.
+
+## Deliverables
+- [ ] Use a fake to test `logIn`
+- [ ] Use stubs to test `getRecommendation`
+- [ ] Use mocks to test `sendPromoEmail`
+
+## Introduction
+
+In testing, it may sometimes be necessary to use objects or procedures that look and behave like their release-intended counterparts but are actually simplified versions that reduce the complexity and facilitate testing. Objects or procedures meant for production can be too slow, unavailable, expensive, opaque, or non-deterministic. Instead, test doubles are often used. There are multiple types of test doubles, but the most well-known/popular are Fakes, Stubs, and Mocks.
+
+### Fakes
+
+Fakes are fully functional classes with a simplified implementation. Usually, they take some shortcuts and are a simplified version of the real object. We use fakes to avoid interacting directly with objects that are too costly to access during testing, like databases. So, instead of querying our actual database, we use a fully functional in-memory database to simulate the same operations.
+
+
+
+### Stubs
+
+A stub is an artificial class that returns pre-configured data. We use it to answer calls during tests. Stubs are used when we can't or don’t want to involve objects that would answer with real data or would have undesirable side effects. For example, instead of querying our real database, we may use a stub with predefined data to simulate only the functionality we need.
+
+
+
+### Mocks
+
+A mock is an instrumented variant of a real class with fine-grained control. We use mocks when we don’t want to invoke expensive production code or when there is no easy way to verify that an intended action was executed. For example, we don't want to send a new email every time we want to test an email system.
+
+
+
+These three terms are usually used interchangeably in practice, but there are some subtle differences. You can find plenty of resources online that go into more detail on the differences if you're still unsure what they are (don't worry, even experienced software developers get it [wrong](https://martinfowler.com/articles/mocksArentStubs.html)).
+
+## Instructions
+
+Clone the repository from [https://github.com/CMU-17-214/f24-lab07](https://github.com/CMU-17-214/f24-lab07). Run the following commands to get started:
+```
+mvn install
+mvn test
+```
+You might notice the tests are taking a very long time to run. Let's increase their performance using test doubles! Look through the provided files to see which methods you will need to test with which types of test doubles. You will find hints on how to proceed there.
+
+All of your tests should be written in `AndrewWebServicesTest.java`. You will also need to implement a fake database in `InMemoryDatabase.java`. For mocks, we will use the [Mockito](https://site.mockito.org/) framework.
+
+## Mockito
+
+We will be using the mocking framework [Mockito](https://site.mockito.org/) in this lab. Here is a simple example to get you familiar with the important parts of Mockito.
+
+We'll use the `Cartoons` class for this example. The `Cartoons` class represents a mapping from characters to the cartoons they belong to.
+```
+public class Cartoons {
+ private Map charactersToCartoons;
+
+ public String get(String character) {
+ return charactersToCartoons.get(character);
+ }
+}
+```
+We use the `mock` method to create a mock of `Cartoons`:
+```
+Cartoons ourMock = mock(Cartoons.class);
+```
+
+Now we can use the `when` and `thenReturn` methods to add behavior to our mocked class (aka stub a method call):
+
+```
+when(ourMock.get("Snoopy")).thenReturn("Peanuts");
+```
+
+So, we've specified that whenever we call `get("Snoopy")`, our mocked class should return "Peanuts".
+
+Next, we execute a method call on our mock:
+```
+String snoopyCartoon = ourMock.get("Snoopy");
+```
+
+Now we use the `verify` method to check that our method was called with the given arguments. The following lines confirm that we invoked the `get` method on the mock and that the method returned a value that matches the expectation we set before:
+```
+verify(ourMock).get("Snoopy");
+assertEquals(snoopyCartoon, "Peanuts")
+```
+
+So, now we've successfully mocked the `Cartoons` class and used a stub method call to write a test for the `get` method in `Cartoons`.
+
+This example covered everything you need to know for mocks in this lab. Feel free to checkout the [Mockito website](https://site.mockito.org/) for more information and documentation on the methods we used above, or look online for other examples using Mockito if the one above wasn't clear. Also, ask your TAs or ask on Piazza if you need any further help. Good luck!
diff --git a/previous-labs/lab08.md b/previous-labs/lab08.md
new file mode 100644
index 0000000..4231afa
--- /dev/null
+++ b/previous-labs/lab08.md
@@ -0,0 +1,36 @@
+# Lab 08 - Java Parallelism
+
+## Deliverables
+
+- [ ] Correctly implement a thread-safe unbounded blocking queue.
+- [ ] Modify the hash map implementation to make it thread-safe.
+- [ ] Describe to the TA why you needed to add synchronization at the specific locations in the hash map implementations.
+
+## Instructions
+
+Clone the repository from [https://github.com/CMU-17-214/f24-lab08](https://github.com/CMU-17-214/f24-lab08). Run `mvn install` to get started.
+
+In the `src` directory you will find:
+
+1. The `edu.cmu.cs.cs214.rec08.queue` package, which provides a `SimpleQueue` interface and an incomplete queue implementation.
+1. The `edu.cmu.cs.cs214.rec08.map` package, which provides a `SimpleHashMap` class.
+1. Various test files in a corresponding package in the `test` directory. These can be run with `mvn test`. Note that these are expected to fail at this point.
+
+The queue implementation provided is "blocking". This means that its methods can pause (without computation) for an arbitrary amount of time. For example, a method that acquires a lock is likely a blocking method if other parts of the program hold the same lock.
+
+Your task is to use primitive Java synchronization to implement a correct unbounded blocking queue from our incomplete implementation, and fix the race conditions in `SimpleHashMap`, which is currently not thread safe.
+
+## Implementing a blocking queue
+
+An _unbounded blocking queue_ is a normal queue except, if the queue is empty upon a dequeue request, then the request is blocked until an element is enqueued by another thread. This behavior is different from the standard `java.util` queue implementations, which either return `null` or throw a `NoSuchElementException` if the queue is empty. In an unbounded blocking queue, the dequeue method will always return a valid element from the queue, although the dequeueing thread might wait arbitrarily long to dequeue an element.
+
+The `edu.cmu.cs.cs214.rec08.queue.UnboundedBlockingQueue` is not yet thread safe; if multiple threads access the same queue concurrently, race conditions can occur and you might obtain unexpected results.
+
+To complete this part of the lab you should:
+
+1. In the `src/test/main` folder, we have provided an `edu.cmu.cs.rec08.queue` test package that tests for the desired behavior of an unbounded blocking queue. Run the tests and understand their expected behavior. These tests will initially fail because the `UnboundedBlockingQueue` as given, is not thread safe and does not block when a thread attempts to dequeue from an empty queue.
+1. Using basic Java synchronization and the `wait` and `notify` methods, eliminate race conditions in the `UnboundBlockingQueue` and make it a correct unbounded blocking queue. In other words, enqueueing an element should always succeed immediately. An attempt to dequeue from an empty queue, however, should block until an element has been enqueued by another thread. To simplify you implementation, prevent race conditions by allowing only one thread to enqueue or dequeue at a time. Use the provided JUnit tests to evaluate the correctness of your implementation. Look at the sample concurrency code from the lectures for more details.
+
+## Implementing a thread safe concurrent hash map
+
+In the `edu.cmu.cs.cs214.rec08.map` package we have provided a `SimpleHashMap` class that is currently not thread safe. Your task is to use primitive Java synchronization to make the implementation thread safe. When you have finished, show the TA your work and explain why synchronization was required where you used it.
diff --git a/previous-labs/lab09.md b/previous-labs/lab09.md
new file mode 100644
index 0000000..5c31b1e
--- /dev/null
+++ b/previous-labs/lab09.md
@@ -0,0 +1,53 @@
+# Lab 9: Concurrency
+
+Homework 5 involves calling external APIs, specifically the [Google Cloud Vision API](https://cloud.google.com/vision?hl=en). This specific API (and many others you will encounter) requires you to set up an account. In this lab, you will set up your environment to work with the Google Cloud API. Since this lab is about environment setup, you may work through any problems you encounter during setup with others, or seek help from the TAs during your lab session.
+
+## Deliverables
+
+- [ ] Sign up for an account and successfully make a call to the Google Cloud Vision API.
+- [ ] Reimplement the Promise code in the repository as async/await.
+- [ ] Identify a reason why async/await is preferred to Promises and explain it to the TA.
+
+## Instructions
+
+### Setting up a Google Cloud project
+
+1. First, download and install the gcloud CLI interface using the instructions [here](https://cloud.google.com/sdk/docs/install). Once you reach the step where you are asked to run `gcloud init`, run it, then continue following the instructions below.
+1. When asked for an account to use, do _not_ use your CMU email address. If you do, you will not be able to redeem the Google Cloud coupon that we provide you. Instead you should use your personal Gmail account, or sign up for a new one.
+1. Create a new "project". This project is used by Google Cloud to organize your resources. This project will be used for both this lab and for Homework 5.
+1. Log in with `gcloud auth login`.
+1. Set the default application authentication with `gcloud auth application-default login`.
+
+### Redeeming your Google Cloud Education Credit Coupon
+
+1. Click on the Student Coupon Retrieval Link in the assignment posted to Canvas
+1. Verify your _school_ email.
+1. Click the redeem link in the email they send you.
+1. In the window that is opened, in the upper-right of the screen **switch to the personal account** you used earlier. At this point you can enter the coupon code from the email. **Make sure that you do redeem the code for a personal gmail account, not your andrew account**, as it will not work for the latter and you might loose the coupon code in the process. If you receive an error that says "You may not have permission to create projects in this organization", double-check that you have switched to the proper account. _You are only able to redeem a code once, if you have difficulty please post privately on Piazza ASAP so that we can try obtain a new one_.
+
+### Enabling billing for your project
+
+1. Open a web browser and [sign in to the Google Cloud console](https://console.cloud.google.com) with your personal account.
+1. Select the project you just created in the box in the upper-left corner of the screen (here, the project I created is called "cmu17-214"):
+
+![lab09_project_select](images/lab09/lab09_project_select.png)
+
+1. Open the context menu to the left of the "Google Cloud" logo and click the "VIEW ALL PRODUCTS" button at the bottom.
+
+![lab09_view_all_products](images/lab09/lab09_view_all_products.png)
+
+1. Click the "Billing" link under "Management".
+
+![lab09_billing](images/lab09/lab09_billing.png)
+
+1. You will get a screen that says "This project has no billing account". On this page click "Link A Billing Account".
+
+1. In the popup, select the new billing account from the dropdown and select "Set Account".
+
+### Enabling the Cloud Vision API
+
+1. Enable the Google Cloud Vision API by following [this link](https://console.cloud.google.com/flows/enableapi?apiid=vision.googleapis.com) and following the prompts.
+
+### Run and modify code
+
+1. Clone the template repository and follow the directions in the README.
diff --git a/previous-labs/lab10.md b/previous-labs/lab10.md
new file mode 100644
index 0000000..2a5b61b
--- /dev/null
+++ b/previous-labs/lab10.md
@@ -0,0 +1,48 @@
+# Lab 10: Introduction to React.js
+
+React is a declarative, efficient, and flexible JavaScript library for building interactive and dynamic user interfaces.
+It lets you compose complex UIs from small and isolated pieces of code - components.
+In this lab, you will learn the fundamentals of React.js and create an interactive quiz application.
+
+## Deliverables
+- [ ] Separate the core and GUI components.
+- [ ] Enhance the UI to highlight the selected answer for a more user appealing experience.
+- [ ] Extend the Quiz component to make the "Next Question" button functional. It should move to the next question and display the total score when all questions have been answered.
+
+## Instructions
+
+### Setup
+Fork and clone the Quiz App repository from: [https://github.com/CMU-17-214/f24-lab10](https://github.com/CMU-17-214/f24-lab10) and run
+
+```
+npm install
+npm start
+```
+![Local Image](https://github.com/CMU-17-214/f24-lab10/blob/main/src/image/starterPic.png)
+
+This will start the front-end server. You will be able to see a simple quiz GUI from the link http://localhost:3000/. You can update the front-end code as the server is running in the development mode (i.e., `npm start`). It will automatically recompile and reload.
+
+In this starter code, you are provided with a Quiz class component.
+The initial state includes a sample question, answer options, and a `selectedAnswer` value.
+The `handleOptionSelect` function allows selecting an answer option and updates the `selectedAnswer` in the component's state.
+The component uses JSX to return HTML-like markup directly, displaying the question, answer options, and the selected answer within the component's return statement.
+> JSX is a syntax extension for JavaScript that lets you write HTML-like markup inside a JavaScript file.
+
+---
+
+### Task 1: Core-GUI Separation
+You will notice the `Quiz.tsx` file contains both the logic and the graphical user interface (GUI) of the quiz application.
+As the project grows, it's best practice to separate the application's core logic from its GUI components.
+
+We've provided a core implementation at [src/core/QuizCore.ts](https://github.com/CMU-17-214/f24-lab10/blob/main/src/core/QuizCore.ts). This core module encapsulates critical quiz operations. It's designed to manage the quiz's functionality independently of the GUI. Your task is to integrate this core with the user interface `Quiz.tsx`. Ensure that your GUI component correctly reflects the data from the QuizCore. Update your component to display the questions and answer options provided by the core. Take care to observe and update the user's selected options and other state changes effectively.
+
+### Task 2: Enhance User Experience
+The starter code displays the user’s selection as text directly and your task is to improve the user experience by making it visually engaging. You have the creative freedom to design how the selected option is displayed.
+> Hint: Change CSS to highlight or apply a border to the selected option.
+
+### Task 3: Manage User Interaction and Scoring
+In the initial implementation, the "Next Question" button remains inactive – it neither progresses to the next question nor displays the final score upon completing all the questions. Your task is to make the "Next Question" button functional and display the total score when all questions have been answered.
+
+When a question is displayed, ensure that the "Next Question" button can take users to the following question. To achieve this, you should check if there is a next question available in the quiz. You can utilize the `hasNextQuestion()` method provided in the core logic.
+
+When all questions have been answered, "Next Question" button should become "Submit" button, and upon clicking it, display the total score. For simplicity, each question in the quiz is worth a score of 1 if answered correctly. You can utilize the `getScore()` method provided in the core logic.
diff --git a/previous-labs/lab11.md b/previous-labs/lab11.md
new file mode 100644
index 0000000..0027771
--- /dev/null
+++ b/previous-labs/lab11.md
@@ -0,0 +1,87 @@
+# Lab 11: TicTacToe Client/Server
+
+## Context
+TicTacToe is a two-player game where the players take turns marking the spaces in a three-by-three grid with either X or O. The first player to place three of their marks in a horizontal, vertical, or diagonal row is the winner. More information about the game can be found [here](https://en.wikipedia.org/wiki/Tic-tac-toe). In this recitation, you will work on an implementation of the TicTacToe game.
+
+This version of TicTacToe is meant to help you set up Homework 6a (User Interface for santorini). It uses a Java backend using a NanoHttpd server and a TS frontend using React.js. This client/server style architecture is commonly used in developing web applications. However, this is a very big topic, we will only cover the essentials for this lab and Homework 6.
+
+## Deliverables
+- [ ] Extend the implementation to show the current player and winner of the game in the “instructions” panel of the game.
+- [ ] Extend the implementation of the game to allow users to undo steps.
+- [ ] Change the styling of the game with CSS files (e.g., change colors).
+
+## Instructions
+Clone the TicTacToe repository from: https://github.com/CMU-17-214/f24-lab11
+
+Refer to the README’s of the projects therein for set up instructions. After you run the program, you will be able to play the game through the GUI as illustrated in the snippet below from the link http://localhost:3000/.
+
+![tictactoe](images/lab11/tictactoe.png)
+
+
+Today’s recitation is all about learning to read and navigate this type of code. The deliverables require you to implement a few very simple improvements, that won’t take you much time at all once you get the hang of how the code is written and structured. So prioritize reading the code and thinking about the flow of information and control.
+
+Instructions: Right now, the game doesn’t tell the user much; once someone has won, it just stops responding. Let’s add an “instructions” element to the HTML body, with the ID “instructions”. The CSS for this element is already present. The text in this element should indicate whose turn it is, or who has won the game (if applicable). Hint: think about all the places affected by this, in terms of client/view (HTML), and server/controller. How do other elements get updated?
+
+Undo: The “Undo” button currently does nothing at all. Let’s wire it up. Much like in the previous exercise, think about all the places where changes need to be made. This one will also require you to get into the game implementation (the model), where most of the functionality needed to facilitate `undo` (tracking a game’s history) is already present. Note that this is strongly supported by the immutable implementation of the game. Again, follow the control flow from the user clicking to (and within) the backend, and back. Use the “history” to implement undo on the game implementation side.
+
+Styling: Make it pretty! You can either expand on the CSS provided -- maybe move it to its own file(s) -- or bring in themes.
+
+
+### Hint: Key Files
+To work with this TicTacToe font-end and back-end implementation, you mainly need to understand 4 files:
+App.tsx: the main component of this React project.
+App.css: the CSS style file for the application.
+Cell.tsx: the React.js component for rendering a cell of the board. You may also define a new style file for the Cell component.
+game.ts: it defines the data structure for the game including the GameState and the Cell. These structures should likely match with the data structures defined in your backend.
+
+
+### Hint: Connecting the Frontend to the Backend
+This program already has the frontend connected to the backend for you. How this works is that within the Java backend, nanohttpd sets up a server that runs at http://localhost:8080/. It also sets up two pages, /newgame for creating a new game and /play to play a certain move. Then within the TS frontend, which React hosts at http://localhost:3000/, which is where you should redirect your page to, whenever you go to the /newage or /play pages, a request is sent to the nanohttpd server with the relevant info. The server then responds to React with a JSON, with the updated cells.
+
+
+
+
+
+## HTML/CSS Review
+HTML is the standard markup language for Web pages. It is very similar to XML. CSS is the language we use to style an HTML document. CSS describes how HTML elements should be displayed and looked like. There are a lot of good online resources for learning HTML and CSS, e.g., HTML Tutorial (https://www.w3schools.com/html/default.asp) and CSS Tutorial (https://www.w3schools.com/css/default.asp). Please read them if you are not familiar with these materials.
+
+## Nanohttpd Review
+Nanohttpd is a lightweight Java server that is good for very basic web applications. Because of how small and lightweight it is, it is good for embedding into already existing applications without adding too much size or latency to the project. The backend server of this game is built upon it. To learn more about it, please refer to this Nanohttpd Tutorial (https://www.baeldung.com/nanohttpd).
+
+## React.js Review
+React.js is a Javascript framework that can be adjusted to work for TypeScript. It is mainly used to make very interactive and dynamic UIs. It allows you to create a complex UI using smaller, isolated pieces of code called “components”. We will use the most basic part of React.js.
+
+### A Little History, Why React.js
+Stage 1, at the very beginning, most resources shared on the internet were static, i.e., engineers can use HTML to define their static web pages. They could simply update the HTML files (at the server backend) to change the content they wanted to share. However, the webpage has limited interactivity and cannot load data dynamically after being rendered by the browser.
+Stage 2, browsers now support Javascript. Engineers can now use Javascript to change their webpages on the client side (browser) to, e.g., add animation, and load data dynamically. E.g., you may find a website that will dynamically update the items as you scroll down the page.
+Stage 3, most of the websites are still relying on the technique in Stage 2, even React.js. However, some old Javascript frameworks require you to manually load the data and add/delete HTML elements. This is painful and tedious when your webpage is highly interactive and dynamic. Thus, frameworks like React.js are created. You can easily bind your data and code with the HTML element, and the framework will automatically update the view.
+
+### Component
+Components are a key element of React.js projects. Each component defines 1) the HTML element about how you want to visualize your data, 2) data bound with this component, e.g., a component is used to render the board, so it should associate with the board data, 3) the code logic for how the data and view will dynamically change or respond to user input. Thus, we can break the web application into small pieces (components), each with its own view definition, data, and implementation.
+
+A very simple component could look like:
+
+![component](images/lab11/component.png)
+
+Each component will have:
+props, an object passed from the caller that holds the data of this component, e.g., in the example, we assume that the parent component of Welcome will pass in the name of this Welcome component instance, which the name will be stored in props, so we can access the name using this.props.name;
+state, an object managed by the component itself that can also hold the data of the component, we can use setState() function to update its value, and the view will automatically update accordingly;
+render(), the function you must implement which defines how the component will be rendered. In React.js, we use JSX (https://legacy.reactjs.org/docs/introducing-jsx.html) to directly define HTML as code in Javascript or Typescript. In the example, we create a tag, and the name is dynamically obtained from the `this.props.name` object. An advantage of React is that, when the value of name is changed, the view will automatically update.
+
+Some notes:
+props should not be changed by the component itself but instead will be changed by its parent component. On the other hand, state is usually the internal data of the component which should be managed by the component itself.
+constructor(props) is not necessary for a component. The only needed one is the render() function
+
+### Proxy
+One thing this lab makes use of is a TypeScript property called proxy. Proxy essentially tells the front end to route all connections to the base url given in the package.json. For this assignment, the proxy routes to http://localhost:8080/, which is the url that the backend server is running on. This means that when we have a command like await fetch(“/newgame”), this will send a GET request to http://localhost:8080/newgame.
+
+![proxy](images/lab11/proxy.png)
+
+![proxy2](images/lab11/proxy2.png)
+
+### JSON
+JSON (JavaScript Object Notation) is a way of formatting data to be easily stored and read by humans. This is similar to a dictionary object with keys and values. An example JSON object is shown below:
+
+![jsonFormat](images/lab11/jsonFormat.png)
+
+This is the format of the information sent from the backend to the frontend.
\ No newline at end of file
diff --git a/previous-labs/lab12.md b/previous-labs/lab12.md
new file mode 100644
index 0000000..4d55cb2
--- /dev/null
+++ b/previous-labs/lab12.md
@@ -0,0 +1,25 @@
+# Lab 12: APIs
+
+## Context
+This lab will test your knowledge of good API design principles. For this lab you will identify and fix API design principle violations inside a repository containing 3 different APIs
+
+## Deliverables
+- [ ] Fix an API design principle violation in the DirManager package
+- [ ] Fix an API design principle violation in the Library package
+- [ ] Fix an API design principle violation in the Weather package
+
+## Instructions
+Clone the repository from: https://github.com/CMU-17-214/f24-lab12
+
+Inside the repository you will find three different APIs: DirManager, Library, and Weather. For each of these, you should identify the flaw, update the code, and also update the documentation to match the code that you corrected. You will get full points for each of them if you are able to both identify and fix the flaws.
+
+## API Design principles
+Here is a list of general API design principles. Each of the violations we have included in this lab correspond to at least one of them.
+![General API Design principles](resources/GPoAD.pdf)
+
+## Hints
+DirManager is an API designed for managing directories. The design of the `newDirectory` method in the `Manager` class has a flaw that should be identified and fixed. _For this specific flaw_ you do not need to worry about creating new objects, feel free to use them as if they already existed.
+
+Library is an API designed for managing user accounts in a library system. The design of the `getBooks` method in the `LibraryAccount` API has a flaw.
+
+Weather is an API designed for interacting with the weather at a specific location. In this case, the `setLengthScale` method has an API design flaw. You may also need to update the `getRainfall` method as well.
\ No newline at end of file
diff --git a/previous-labs/lab13.md b/previous-labs/lab13.md
new file mode 100644
index 0000000..ac2f65f
--- /dev/null
+++ b/previous-labs/lab13.md
@@ -0,0 +1,34 @@
+# Lab 13 - Design Pattern Review
+
+In this recitation, you will revisit three crucial design patterns: **Proxy**, **Composite**, and **Decorator**. For each pattern, your task is to articulate key aspects, discuss why they are beneficial or problematic, and demonstrate their use in UML diagram in the context of *Santorini's God Cards*.
+
+## Deliverables
+
+- [ ] Fill out the **Proxy** pattern template and answer follow-up questions of the TA
+- [ ] Fill out the **Composite** pattern template and answer follow-up questions of the TA
+- [ ] Fill out the **Decorator** pattern template and answer follow-up questions of the TA
+
+## Introduction
+
+Throughout the semester, we've delved into many commonly used design patterns, including **Proxy**, **Composite**, **Decorator**, **Strategy**, **Template**, **Observer**, and **Adapter**.
+
+In this lab, we will focus on the first three.
+
+For each design pattern, you are expected to provide information in five sections:
+
+- **Description**: Define the key characteristics that distinguish the pattern from others.
+- **Pros**: Why should you use this pattern? What specific problems does it solve and what design principles does it support?
+- **Cons**: Why might you want to avoid this pattern? What design challenges or complications could it introduce?
+- **UML Diagram**: Draw a UML object model for the pattern.
+- **Example**: Reflect on your past programming experiences where this pattern could have improved your solution. If you can't think of a personal example, describe a scenario where using this pattern would have made the solution worse.
+
+## Instructions
+
+### Download the cheatsheat
+
+Create a copy of the template at
+
+### Tips
+
+- Strive to devise your explanations before consulting external sources.
+- While you are only required to explain three design patterns to the TA, feel free to continue filling in the information for the remaining patterns and seek clarification or assistance from the TA if needed.
diff --git a/previous-labs/resources/GPoAD.pdf b/previous-labs/resources/GPoAD.pdf
new file mode 100644
index 0000000..47a6a2d
Binary files /dev/null and b/previous-labs/resources/GPoAD.pdf differ
diff --git a/quizzes/07-design-critique/07-design-critique.pdf b/quizzes/07-design-critique/07-design-critique.pdf
new file mode 100644
index 0000000..f75cab5
Binary files /dev/null and b/quizzes/07-design-critique/07-design-critique.pdf differ
diff --git a/quizzes/07-design-critique/07-design-critique.tex b/quizzes/07-design-critique/07-design-critique.tex
new file mode 100644
index 0000000..04f391e
--- /dev/null
+++ b/quizzes/07-design-critique/07-design-critique.tex
@@ -0,0 +1,37 @@
+\documentclass{exam}
+
+\begin{document}
+
+\makebox[0.75\textwidth]{Name:\enspace\hrulefill}
+
+\vspace{10mm}
+\makebox[0.75\textwidth]{Andrew ID:\enspace\hrulefill}
+
+\section*{Trouble Rules:}
+
+2-4 players are trying to move their pieces from their home to their finish
+zone. Players roll a D6 and move their pieces clockwise, rolling a 6 lets them
+roll again. To exit their home zone, they must roll a 6 and move a piece from
+their home to their start position. Landing on an opponent's piece sends it back
+to the opponent's home zone. Players may not have two of their pieces in the
+same position. Exact rolls are required when moving to the finish zone. The
+first player to have all of their pieces in their own finish zone is the winner.
+
+\begin{questions}
+ \question Circle the nouns and verbs in the above description.
+
+ \question Draw a domain model using the verbs and nouns that you circled.
+ \vspace{\stretch{1}}
+
+ \question Draw a system sequence diagram for the interaction \emph{player
+ takes a turn}.
+ \vspace{\stretch{1}}
+ \clearpage
+
+ \question Draw an object model for this game.
+ \vspace{\stretch{1}}
+
+ \question Draw an interaction diagram for this game.
+ \vspace{\stretch{1}}
+\end{questions}
+\end{document}
\ No newline at end of file