Final Project

Assigned: 3/5/2026
Fabrication Session: 4/30/2026 during lecture or sign up for open hours (check Ed posts from TAs) Due: 5/15/2026 at 11:59 PM


Overview

You will design and fabricate your own knitting pattern using code. This is your chance to be creative with what you’ve learned — pick a pattern that excites you, write code that generates it, and knit it on the machine.

The project is graded on quality of execution, not complexity. A simple pattern with clean, well-documented code and a successful knitted piece scores just as well as an ambitious one. Focus on doing something you understand well.


Project Milestones

There are three milestones for the project:


Getting Started: Starter Template

To help you get started, we provide a zip folder for starter code. You are not required to use it! Feel free to start from scratch if you prefer. Using or not using the starter code has no effect on your grade.

The template gives you:

  • A clean file structure with stub functions to fill in
  • A generate_pattern() function where you write your pattern logic, returning a list or 2D list
  • A pattern_to_knitout() function where you call your knitout helpers
  • A main() entry point that wires everything together

You are responsible for providing your own knitout_helpers.py. You can reuse and adapt helper functions from prior homeworks, combine them into a single file, or write new ones from scratch. A project that thoughtfully reuses and extends existing helper functions, plus a well-written generate_pattern() that produces an interesting pattern, is already a strong project.

If you are using the additional helper classes, you can refer to the API reference to understand what each class and its methods do, and how you can use them to construct your own patterns.


Requirements

Your project must at minimum:

  • Generate a knitting pattern programmatically (no hardcoded patterns)
  • Be organized into at least two functions, where one calls the other
  • Have at least one parameter that meaningfully affects the output
  • Use at least one loop
  • Produce valid knitout output that fabricates a working piece
  • Include clear documentation and follow the course style guide

Object-oriented programming is not required. The goal is solid CS1 fundamentals: variables, functions, data structures, and control flow. That said, students who incorporate OOP in a meaningful way into their projects (e.g., a class that encapsulates pattern state or generation logic) can earn up to 5 bonus points on top of the 100-point project score.


What to Submit

Submit on Gradescope (linked from Moodle) by 5/15 at 11:59 PM:

  • project.py (or equivalent — your main code file)
  • knitout_helpers.py (your helper functions, whether adapted from HW2/HW3 or written from scratch)
  • Any additional Python files you created for the project
  • Your generated .k knitout file(s)
  • A PDF final report (2–5 pages including images), see Final Report for details
  • Photos of your knitted piece (optional if already included in report)

Fabrication

The fabrication session is 4/30 during lecture. Come with working code and a knitout file ready to send to the machine. If your piece doesn’t come out as expected, you will have time to debug and re-knit.

Dimensions: Keep your design at most 10 inches (no more than 130 needles or 100 rows). Larger pieces are more prone to mid-knit failures. If you use more than 60 stitches in any dimension, test a smaller version first.

Yarn: Each student will have access to at least one cone (~450g) across all colors. A 40×40 piece weighs no more than 3 grams, so you have plenty to work with.

If you’re not ready by 4/30, sign up for open hours in Week 16 or Finals week, but try to be ready for the session so it’s less stressful.


Academic Integrity

Your project must be your own work. Review the AI policy.

Allowed: Course materials, Think Python, Python documentation, discussing ideas with classmates (not sharing code), citing Stack Overflow snippets, asking instructor/TA for debugging help.

Not allowed: Having AI generate your project code, copying substantial code from others without attribution, using AI to write code you don’t understand.


FAQ

Q: Can I change my idea after the proposal?

A: Minor changes are fine. Major changes need a conversation with the instructor. Contact us ASAP if you realize your original plan isn’t working so that we know what to expect.

Q: What if my pattern doesn’t knit correctly?

That’s why we have the fabrication session! You’ll have time to debug and re-knit if needed. We grade on whether your knitout is valid and whether the final knitted piece works, not on getting it perfect the first time.

Q: Can I work in groups?

A: No, the final project is individual. You can discuss ideas and help each other debug, just like with homework.

Q: How complex does my project need to be?

A: A simple pattern executed well scores just as well as a complex one. Quality over complexity!


Questions? Post on Ed Discussion or come to office hours.