README.md

Berkeley CS170 Assets Download Script

A simple bash script to automatically download discussion worksheets (dis) and homework assignments (hw) from Berkeley's CS170 (Efficient Algorithms and Intractable Problems) course.

Features

  • Download discussion worksheets or homework assignments
  • Automatically downloads both problem sets and solutions
  • Skips files that don't exist on the server
  • Customizable download range
  • Organizes files into separate directories

Requirements

  • bash
  • wget

Usage

./download-Berkeley-CS170.sh <type> [max_number]

Parameters

  • <type> (required): Type of files to download
    • dis - Discussion worksheets
    • hw - Homework assignments
  • [max_number] (optional): Maximum number to download (default: 11)
    • Downloads from 01 to the specified number

Examples

Download discussion worksheets 01-11 (default):

./download-Berkeley-CS170.sh dis

Download discussion worksheets 01-15:

./download-Berkeley-CS170.sh dis 15

Download homework assignments 01-10:

./download-Berkeley-CS170.sh hw 10

Output

Files are downloaded to directories based on type:

  • Discussion worksheets: cs170_dis/
  • Homework assignments: cs170_hw/

For each number, the script downloads:

  • Main file: dis##.pdf or hw##.pdf
  • Solution file: dis##-sol.pdf or hw##-sol.pdf

Files that don't exist on the server are automatically skipped.

Source

Files are downloaded from: https://cs170.org/assets/pdf/