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