C Projects
Tools close to the machine: bytes and bits, binary files, stacks, linked lists and processes.
- Vending Machine
The brain of a snack machine: products and prices, coins in, the snack and the change out in real coins from its own tubes, and the technician's report.
- Hex Dump
See every byte of a file that looks fine but isn't: a hex dump with offsets, the bytes as text, the same lines written once, and what the file holds.
- Weather Packets
Unpack weather reports packed into 32-bit numbers with bit operations, throw out the broken ones, sum up each station and pack reports the other way.
- Key-Value Store
A shop's stock saved on disk: one binary file of slots of the same size, a hash that jumps straight to a key, keys that want the same slot, and deleting.
- Shop Calculator
A calculator that takes a whole calculation at once, with brackets, worked out the way real ones do with two stacks, with errors and variables.
- Level Compressor
Pack the maps of a pixel art game with run-length encoding, unpack them again, find broken data and show that nothing was lost.
- PGM Image Tool
A terminal tool for black and white scans: read a PGM picture into memory, show it as text, invert, brighten, flip, rotate, crop, blur and save it.
- Print Spooler
The program between an office and its printers, with a linked list for a queue: urgent jobs first, printing minute by minute, cancelled jobs, stuck paper and a report.
- Warehouse Robot
Drive a warehouse robot between stations on a map drawn with characters: the shortest ways by breadth-first search, the whole trip, and the way drawn on the map.
- Parallel Counter
Count the words of a newspaper archive with several processes at once: one child process for each part, the numbers sent back through pipes and added up.