CS106L Activities106L

The in-class activities for CS106L at Stanford. Each day is a short mission you work through during lecture, and the C++ you write is compiled and run right here in your browser.

Sign in to get credit. Signing in is how your progress is recorded and how your work counts — it also carries your progress between devices.

  1. Day 2Optional activityTypesBuild a hand of cards while practicing today's concepts!13 steps
  2. Day 3ActivityInitialization and ReferencesGive variables their first values three ways, catch narrowing with braces, and change the real thing with references.7 steps
  3. Day 4ActivityStreamsSix focused exercises covering the core C++ stream topics.6 steps
  4. Day 5ActivityContainersLap times, team sponsors, and the containers that hold them.5 steps
  5. Day 6ActivityIterators and PointersFive multiple-choice questions and two short coding activities on iterators and pointers.5 steps
  6. Day 7ActivityClassesRun a building's elevators while practicing classes and inheritance!7 steps
  7. Day 9ActivityThe C++ Template FactoryFive factory-themed challenges: stamp out typed products from a template blueprint, implement a storage bin, and enforce read-only factory access with const correctness.5 steps
  8. Day 9ActivityTemplate FunctionsPrint grapes, oranges and anything else while practicing template functions!5 steps
  9. Day 10ActivityFunctions & LambdasGive a search algorithm a brain, capture a secret threshold, sort names your way, and explore lazy views!5 steps
  10. Day 11ActivityOperator OverloadingRank, team up, and befriend superheroes by overloading operators!6 steps
  11. Day 13ActivitySpecial Member FunctionsBuild a toy factory while practicing copy construction, member initializer lists, deep copies, deleted operations, and the Rule of Three!5 steps
  12. Day 14ActivityMove SemanticsStop copying a million pixels you're about to throw away: give a Photo class move semantics!4 steps
  13. Day 15ActivityOptional & Type SafetyPractice strong typing, missing values with std::optional, safe division, and scoped enum comparisons.5 steps
  14. Day 16ActivityRAII & Smart PointersMake sure no fruit rots in memory: pack an RAII lunchbox, share fruit with smart pointers, and build a whole orchard!7 steps