CS 70

Homework 2: Embroidery Meets Infographics

In this assignment, you will practice

  • Writing functions in C++
  • Reading input from a file
  • Working with statically sized arrays of primitives
  • Applying your CS skills to communicate information from other disciplines

Specifically, you’ll use a C++ Turtle class to generate embroidery patterns that visualize data.

You can even have an embroidery machine stitch out your final pattern!

  • Duck speaking

    Wait, really??! Like, actually stitched out?

  • LHS Cow speaking

    Yes! A while ago, the CS 70 instructors convinced the Center for Teaching and Learning to get us a couple of programmable embroidery sewing machines! They read in files in the format your code will generate, and use those files to know what stitches to put where. Those machines are now in the Maker Space!

Getting Started

This assignment is paired, and your repository belongs to your pair.

Your repository is already set up for both partners. Your pairing came from the availability and pairing board, and the repository is named after your group.

Both partners have push access to your shared repository, so either of you can be logged in during a coding session and still access all the work you've done together.

  • Hedgehog speaking

    The link says the page doesn't exist!

  • LHS Cow speaking

    That usually means you are not in the CS 70 GitHub organization yet, rather than that your repository is missing. GitHub hides things you're not allowed to see.

  • Cat speaking

    So “not found” and “not allowed” look the same on purpose?

  • LHS Cow speaking

    Exactly. That approach means people can't go fishing for the names of private repositories.

  • RHS Cow speaking

    On the server, you can run cs70-fix-access, which will check your membership and sort most of the basic issues out for you.

Clone Your Repo

Log into the CS 70 server, like this

ssh username@cs70.cs.hmc.edu

and then clone your repository on the CS 70 server to get started:

git clone https://github.com/hmc-cs70-fall2026/repo.git

Outline

Ask for (and give each other) help!

Post your questions there, and be sure to answer each other's. Even if you're not 100% sure of an answer, it's okay to jump in and try—we're all here to help each other!

Helpful Hints

Pair Programming

Remember:

  • You must work on coding and writing tests as a pair, according to the pair-programming guidelines.
  • You can (and probably should) read this assignment writeup and think about it on your own, however.

Mastering Version Control

  • Commit Early, Commit Often — Remember to add and commit your files regularly! In particular, don’t forget to push them when you’re finished.
  • Don't Add Extraneous Files — As a general rule (even outside CS 70!), you should not add generated files of any form (e.g., compiled machine code, generated images) to a repository when those files can be automatically produced from other files already in the repository. This week, we will make an exception for the embroidery and image files you will create, so that your grutors can see them alongside your code in your repository.

Useful Information

Other Resources

As you work through this assignment, we suggest you keep the following references handy:

  • Sections 1.5, 2.3.1, and 2.4 (up to but not including 2.4.1) of the C++ Primer, 5th Edition.
    • To access the book from the 5Cs campuses: click the link, sign in with your campus credentials, and then click Start.
    • If you're off campus, or if that link doesn't work, use this link to log into the O’Reilly Safari Learning Platform: Academic Edition and then search there for C++ Primer (or try clicking the above link again once logged in).

Grading

Completing this assignment is worth 122 points, and will be graded as follows:

  • 75 points: Coding (completeness, correctness, clarity/style)
  • 47 points: Written questions
  • It is particularly true this week that we reserve the right to give extra credit for especially interesting or creative submissions.

(When logged in, completion status appears here.)