A legost.in portal
Computer ScienceHow programs, machines and the limits of computation work
Textbooks where the code runs right on the page: on our server, in a sandbox, with streaming output. Start with the base course — from your first line of Python to the processor, networks, ciphers and problems no computer will ever solve.
Courses
Open
Base course
A computer science degree in one interactive textbook: 66 chapters, each with its own story, tasks checked on the server.
Soon
Algorithm catalog
Hundreds of algorithms with visualisations, explanations, complexity and code you can run and break.
Soon
Systems and networks
Operating systems, file systems, protocols and distributed databases — deeper than the base course.
Soon
Computer graphics
From a pixel and rasterisation to a ray tracer you write yourself.
How you learn here
- 01The code really runsEvery cell goes to the server, runs in an isolated sandbox, and the output streams back line by line — input() works too.
- 02Tests check your solutionsWrite a function and the server runs it against hidden tests and shows the input it breaks on. Step-by-step hints, a worked solution after your attempt.
- 03See how the machine thinksThe Steps button records your program running: line by line, with the call stack, the variables and arrows to objects in memory.
- 04Every chapter has a storyA moth in the Mark II log book, a sort invented in Moscow, the worm that brought down the 1988 internet. Each chapter grows out of the one before.