CS 70

Homework 4: Something Amazing

  • LHS Cow speaking

    In this homework, we're going to do something amazing! Mazes!

  • RHS Cow speaking

    Take a look at the image below. It's small enough that you can probably figure out how to solve if you stare at it for a bit. (Want a spoiler? Click the image!)

Maze

  • LHS Cow speaking

    Of course, that was a fairly small maze. But there's no upper limit on how big a maze could be, at least in principle. Here's a bigger one if you want to try it out.

  • Goat speaking

    Meh. Too much work.

  • Duck speaking

    I bet we could write a program to solve mazes!

  • LHS Cow speaking

    Funny you should say that, Duck. That's exactly what this assignment is about.

In this assignment, you will develop a program that can solve mazes of arbitrary size, using data structures you've made entirely from scratch (including making a class that works just like std::vector or Python's list()). In doing this work, you'll gain experience with

  • Writing code with dynamically allocated arrays of both primitives and objects on the heap.
  • Memory management using new and delete.
  • Debugging memory management problems with valgrind.
  • Evolving a codebase over time, including writing new classes from scratch.
  • Maintaining a Makefile.
  • Testing your code (using the CS 70 testing library).

Getting Started

This assignment is paired, and your repository belongs to your pair. This is a new pairing (see the Partner Contract); your repository has already been made and is named after your group.

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.

  • 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. 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

Useful Information

Other Resources

You might find Sections 12.1 and 12.2 of the textbook, C++ Primer, 5th Edition, to be helpful.

As always, ask and answer each other's questions on the Getting Help with Homework 4 page.

In addition, please review the following pages in the Help Pages:

Grading

This assignment is graded in these parts:

  • your partner contract;
  • the written questions;
  • your code: the autograder (it builds without warnings, passes cpplint, has the right files, and passes our tests), and a code review of its clarity and style by the course staff;
  • and, if you take up one of the Your Turn ideas, bonus points.

Each question shows its points beside it, on its own page, so there's only one place to look. Your grade for the assignment is the percentage of its points you earned, which is what the gradebook shows.

(When logged in, completion status appears here.)