Labs · Part 2 of every class · from 15:00 onwards
Code you can check.
Every lecture has a lab. You turn the week’s idea into a working program, tests check it instantly, and your score appears on GitHub. The workflow comes from Harvard’s CS50 team: Classroom 50 for assignments and autograding, VS Code in the browser for coding, fast feedback all the way. The first seven labs are in C; then Python, SQL and the web.
The loop
Four steps, every week
-
01
Accept the lab
On classroom50.org, one click creates your own private repository with the starter code, the tests and a notebook for that week.
classroom50.org
-
02
Open it in Codespaces
VS Code in your browser, the same experience as Harvard’s cs50.dev. gcc, make, the CS50 library and the tests are installed for you. Nothing to install on the lab PCs.
Code → Codespaces
-
03
Write C, compile, self-check
Fill in the TODOs, compile with make, run your program. Then run the checks as often as you like: :) means correct, :( tells you exactly what is wrong.
make hello · python3 check.py
-
04
Push to submit
Every push is graded by GitHub Actions within a minute or two, and your score is published as a Release in your repository.
git push
Starting without the instructor
The lab starts at 15:00 onwards, and the instructor may join a few minutes later. You never need to wait: open the lab page, follow the numbered steps, ask your neighbor before you ask the instructor. Stuck for more than 10 minutes on the same error? Write it down and move to the next task.
Notebooks, even for C
Every lab has an exploration notebook that runs in Google Colab with nothing installed: it writes C files, compiles them with gcc and runs them, cell by cell. Not graded, great for playing.
How labs count
Every lab is due on the Friday of its week at 23:59; late work loses 10% per day, up to five days. Weekly labs are autograded for instant feedback. They are the practice ground for the exams and the project, and completion is tracked. Labs are also where you build the skills for the semester project.
All labs
Lab list
- L01 Hello, Scratch Make your own copy of the lab on GitHub, rebuild the meow program with a custom block, build a small Scratch project of your own, and answer seven questions about bits. No C yet. week 2 · Mon, Sep 28 · due Fri, Oct 2 · 23:59 · Scratch · GitHub · Codespaces · Scratch · custom blocks · binary · ASCII · pseudocode open
- L02 C Kickstart Your first real C programs: three one-line warm-ups (hello, greet, bits), then mario pyramids, a calculator with validated input and cash change-making with a greedy loop. Accepted and autograded on Classroom 50. week 3 · Mon, Oct 5 · due Fri, Oct 9 · 23:59 · C · Classroom 50 · make · printf · get_int · do-while · nested loops · casting · greedy open
- L03 Strings and Ciphers Arrays and strings under the hood: min, max and average of an array through functions; a readability grade for any text; and a Caesar cipher driven from the command line with a proper usage message and exit code. week 4 · Mon, Oct 12 · due Fri, Oct 16 · 23:59 · C · arrays · functions with arrays · strings · strlen · ctype · argc/argv · exit codes · Caesar open
- L04 Search and Sort Write linear and binary search with a comparison counter and watch the gap; implement selection sort and bubble sort chosen from the command line; and write two recursive functions, a pyramid and a factorial. Then measure the algorithms in a notebook. week 5 · Mon, Oct 19 · due Fri, Oct 23 · 23:59 · C · linear search · binary search · selection sort · bubble sort · recursion · Big O open
- L05 Pointers and Pixels Swap through pointers, copy a string by hand, allocate and free memory without leaks, and turn a color BMP image gray by editing its bytes. week 6 · Mon, Oct 26 · due Fri, Oct 30 · 23:59 · C · pointers · malloc/free · valgrind · strcpy · file I/O · BMP coming soon
- L06 Build a Hash Table From a linked list to a hash table for a word list: insert, search, size, unload, all valgrind-clean, then measure lookup time against a plain array. week 7 · Mon, Nov 2 · due Fri, Nov 6 · 23:59 · C · linked list · hash table · hash function · valgrind · trade-offs coming soon
- L07 C to Python Rewrite three earlier labs in Python, use lists and dictionaries instead of arrays and hash tables, and time C against Python on the same task. week 9 · Mon, Nov 16 · due Fri, Nov 20 · 23:59 · Python · Python · lists · dicts · exceptions · sys.argv · timing coming soon
- L08 Minimax and a Model Write an unbeatable tic-tac-toe player with minimax, then call a large language model from Python with a system prompt you design and evaluate its answers. week 10 · Mon, Nov 23 · due Fri, Nov 27 · 23:59 · Python · minimax · recursion · APIs · prompt engineering · evaluation coming soon
- L09 Query the World Design tables for a real CSV, load it into SQLite, answer questions with SELECT and JOIN, add an index, and demonstrate and fix an SQL injection. week 11 · Mon, Nov 30 · due Fri, Dec 4 · 23:59 · SQL + Python · SQL · SQLite · schema · JOIN · index · parameterized queries coming soon
- L10 Your First Web Page Build a page with a form, style it with CSS, add JavaScript that reacts to the user, and publish it on GitHub Pages so it has a real URL. week 12 · Mon, Dec 7 · due Fri, Dec 11 · 23:59 · HTML/CSS/JS · HTML · CSS · JavaScript · DOM · events · GitHub Pages coming soon
- L11 Hash, Crack, Defend Hash passwords, crack the weak ones with a dictionary attack, add salt so the attack stops working, and check a password against known breaches without ever sending it. week 13 · Mon, Dec 14 · due Fri, Dec 18 · 23:59 · Python · hashing · salting · dictionary attack · k-anonymity · APIs coming soon