CS 70

Homework 3: ASCIImation

Background: How Animation Works

Animation is a medium in which successive still images are rapidly presented one-after-another to give viewers the impression of smooth movements. To understand how this process works, imagine being presented with a still photograph of an object in motion. Then, a short while later, imagine you were shown another image of the same motion in progress (and then another, and another). As the delay between seeing the photographs decreases, the depicted motion would begin to appear smoother—it would be as if you were watching the original motion itself rather than a series of snapshots. The point at which a viewer perceives smooth motion from successively presented still images is known as the flicker-fusion threshold. It occurs for most humans when these images (known as frames) are presented at a rate of about 10–15 still images per second.

In traditional animation, frames might be drawn directly onto celluloid (“cel” animation), photographed physical objects (as in plasticine or clay animation), or “rendered” with computers (where each frame is computed from various data sources). But for this assignment we will be using the terminal to display our animation using classic ASCII art.

  • Goat speaking

    Meh. Doing stuff in a terminal is so retro. Will we actually learn anything useful?

  • L-Diskie speaking

    Hey, retro is the new modern! And ASCII art is a classic medium for computer graphics.

In this week's assignment, you will practice

  • Implementing member functions (including constructors) for a user-defined class.
  • Writing a Makefile.
  • Working with statically sized arrays of primitives.
  • Creating real-time terminal animations (using the standard Unix ncurses library behind the scenes).

Getting Started

This assignment is paired, and your repository belongs to your pair. We have already made it—there is nothing to accept and no name to agree on. Your pairing came from the availability and pairing board, and the repository is named after your group. (It is the same pair as Homeworks 1 and 2.)

Both of you have push access to that one repository, so you are working in the same place rather than each having a copy to reconcile later. That is the point of pair programming and it is also the thing that makes it easy to see who did what.

  • 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 what you cannot see rather than admitting it is there.

  • Cat speaking

    So "not found" and "not allowed" look the same on purpose.

  • LHS Cow speaking

    Exactly—so that nobody can go fishing for the names of private repositories. On the server, cs70-fix-access will check your membership and sort most of this out for you.

Clone your repository on the CS 70 server to get started:

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

Outline

Helpful Hints

When running your animation on the course server (cs70.cs.hmc.edu), make sure your terminal window is large enough to display the full animation. The default size of an asciimation is 80 columns by 40 rows, so resize your terminal accordingly before running ./our-movie.

Pair Programming

Remember:

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

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) to a repository when those files can be automatically produced from files already in the repository.

Useful Information

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!

Other Resources

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

  • The following sections of the C++ Primer, 5th Edition:
    • Sections 3.5.1–3.5.2, for a review of primitive arrays
    • Section 7.1.2, for different ways to define member functions
    • Section 8.2, to better understand the file-reading code in the starter code
  • We have also posted a new resource page this week: Working with Makefiles
  • Some time ago, a particularly industrious grutor wrote an Unofficial CS70 Textbook (!!) and the compilation case study contains multiple examples of Makefiles.
  • Remember that the CS 70 Idioms we expect to see in your code are summarized on the Coding Idioms page—not following them will result in lost points on your homework:

Grading

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

  • 19 Points: Written Questions
  • 16 Points: Makefile
  • 60 Points: Coding (completeness, correctness, clarity & style)

(When logged in, completion status appears here.)