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.
Meh. Doing stuff in a terminal is so retro. Will we actually learn anything useful?
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).
Let's Go!
Both team members should click the button below to accept the assignment:
- Accept HW3 on GitHub Classroom
- (Choose the same team you created in HW1)
Outline
- Part 1: Written Questions
- Part 2: Make Your Makefile
- Mini Lesson: Static Class Members
- Part 3 Exploring and Finishing the
BoundingBox
Class - Part 4: Exploring and Finishing the Sprite Class
- Part 5: Exploring the Display Class
- Part 6: Exploring and Finishing the
Asciimation
Class - Part 7: Make Your First Asciimation
- Part 8: Set Your Sprite in Motion
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 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
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
- As always, we encourage you to ask (and answer) questions on Piazza as you work!
- 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 100 points, and will be graded as follows:
- 19 Points: Written Questions
- 16 Points: Makefile
- 60 Points: Coding (completeness, correctness, clarity & style)
- 5 Points: Correctly denoting all team members in Gradescope submission
(When logged in, completion status appears here.)