Learn to code with Xher

Every working in the arcane arts follows exact steps in an exact order. So does every program. Xher teaches you to write real code, with each lesson framed as a small piece of ritual craft, and everything runs right here in your browser.

Every lesson you pass earns experience toward level 100. See who leads the Hall of Adepts →

Keep today's Daily Rite: one short challenge a day. Finish a part of a course and you earn its Seal of Completion.

Members only

The Learn section is included with the Reader and Downloader memberships, alongside unlimited reading and Xher's chat. Membership unlocks every lesson of every course, the in-browser Python, JavaScript and SQL workbench, and progress saved to your account.

More of the craft

Courses and tracks

Python · 140 lessons · Beginner to advanced

Python Basics

A hundred and forty lessons that take you from your first print() to writing classes, generators and small complete programs. Part I teaches the tools one at a time, Part II combines them into steadily harder workings, and Part III introduces the advanced arts. In every part, each lesson is followed by a practice lesson on the same tool. Xher teaches each one, every example is a small piece of ritual work, and the code is real Python that runs right here in your browser.

Reader & Downloader members
Course outline 140 lessons in 3 parts
Part I · Foundations Lessons 1–40
  1. 1 The First Incantation print()
  2. 2 The Longer Invocation print(), practised
  3. 3 Binding Names Variables
  4. 4 Changing What a Name Holds Variables, practised
  5. 5 Runes of Text Strings
  6. 6 Measuring the Runes Strings, practised
  7. 7 Numbers of Power Arithmetic
  8. 8 The Alchemist's Ledger Arithmetic, practised
  9. 9 Transmutation Type conversion
  10. 10 Reading the Scrolls Type conversion, practised
  11. 11 String Sorcery String methods and f-strings
  12. 12 The Scribe's Flourish String methods and f-strings, practised
  13. 13 Omens of Truth Booleans and comparisons
  14. 14 Weighing the Omens Booleans and comparisons, practised
  15. 15 The Forked Path if and else
  16. 16 The Second Fork if and else, practised
  17. 17 The Many Doors elif
  18. 18 The Seven Doors elif, practised
  19. 19 Binding Wards and, or, not
  20. 20 The Triple Ward and, or, not, practised
  21. 21 The Endless Circle while loops
  22. 22 Until the Cauldron Boils while loops, practised
  23. 23 Counting the Chant for loops and range()
  24. 24 The Measured Chant for loops and range(), practised
  25. 25 Tracing the Sigil Looping over strings
  26. 26 Reading the Hidden Letters Looping over strings, practised
  27. 27 The Grimoire Lists
  28. 28 The Second Shelf Lists, practised
  29. 29 Inscribing the Grimoire List methods
  30. 30 Rearranging the Altar List methods, practised
  31. 31 Pages and Passages Indexing and slicing
  32. 32 Cutting the Scroll Indexing and slicing, practised
  33. 33 Crafting a Ritual Defining functions
  34. 34 A Ritual With Many Parts Defining functions, practised
  35. 35 Offerings and Returns Parameters and return
  36. 36 Rituals That Answer Parameters and return, practised
  37. 37 Rituals Within Rituals Combining functions, loops and lists
  38. 38 The Offering Count Combining functions, loops and lists, practised
  39. 39 The Final Rite Capstone project
  40. 40 The Rite of Preparation Capstone practice: Part I combined
Part II · Combining the Tools Lessons 41–80
  1. 41 The Apprentice's Review Review: functions, f-strings and choices
  2. 42 The Journeyman's Review Review: functions, f-strings and choices, in more branches
  3. 43 Counting by Steps range() with a step
  4. 44 Stepping Backwards range() with a step, forwards and backwards
  5. 45 Breaking the Circle break and continue
  6. 46 The Interrupted Vigil break and continue, keeping what you saw
  7. 47 Circles Within Circles Nested loops
  8. 48 The Lattice of Wards Nested loops that build and compare
  9. 49 Reading Words for Omens Examining strings character by character
  10. 50 The Letter Counter Examining strings by position, letter against neighbour
  11. 51 Splitting the Scroll split() and join()
  12. 52 Rewriting the Scroll split() and join(), reshaping each word
  13. 53 The Shifting Cipher ord(), chr() and wrapping with %
  14. 54 The Atbash Mirror ord() and chr(), mirroring the alphabet
  15. 55 Measures of the Rite sum(), min(), max() and returning several values
  16. 56 The Range of Readings sum(), min(), max() and tuples, put to further work
  17. 57 Sifting the Offerings Building new lists and list comprehensions
  18. 58 The Second Sifting List comprehensions, transforming and filtering together
  19. 59 Paired Seals Tuples and unpacking in loops
  20. 60 Sealed Pairs Tuples and unpacking, building new pairs
  21. 61 The Codex Dictionaries
  22. 62 The Second Codex Dictionaries: inverting and merging
  23. 63 Counting with the Codex Counting and tallying with dictionaries
  24. 64 The Word Tally Tallying with dictionaries: counting words
  25. 65 Walking the Codex Looping over dictionaries and sorted()
  26. 66 The Sorted Codex Looping over dictionaries: finding extremes and building reports
  27. 67 Rituals With Defaults Default values and keyword arguments
  28. 68 Rituals With Options Default values and keyword arguments: optional parts
  29. 69 Warding Against Bad Input try and except
  30. 70 Warding the Scales try and except: guarding several risky steps
  31. 71 The Ledger of Rites Lists of dictionaries
  32. 72 The Second Ledger Lists of dictionaries: grouping and averaging
  33. 73 Ordering the Pantheon Sorting with a key
  34. 74 Ordering the Shelves Sorting with a key: several orderings
  35. 75 The Spiral Stair Recursion
  36. 76 The Deeper Stair Recursion: nested lists and repeated steps
  37. 77 The Ritual Engine Combining it all: processing commands
  38. 78 The Second Engine Processing commands: an altar of candles
  39. 79 The Grand Working Capstone: a grimoire manager
  40. 80 The Grand Archive Capstone: a library manager
Part III · The Advanced Arts Lessons 81–140
  1. 81 The Shared Circle Sets
  2. 82 Circles of Allegiance Sets, practised
  3. 83 Uncommon Runes Sets in practice
  4. 84 Echoes in the Chant Sets in practice, keeping track of what you have seen
  5. 85 Comprehensions of the Codex Dictionary and set comprehensions
  6. 86 The Codex Remade Dictionary and set comprehensions, practised
  7. 87 Binding Pairs zip() and enumerate()
  8. 88 Threads of the Loom zip() and enumerate(), practised
  9. 89 Swift Judgements any(), all() and generator expressions
  10. 90 Verdicts of the Tribunal any(), all() and generator expressions, practised
  11. 91 Small Spells lambda, map() and filter()
  12. 92 Swift Sigils lambda, map() and filter(), practised
  13. 93 Open-Ended Rituals *args and **kwargs
  14. 94 The Gathering of Many *args and **kwargs, practised
  15. 95 Rituals That Remember Nested functions and closures
  16. 96 The Keeper's Purse Closures, practised with nonlocal
  17. 97 Enchanting a Ritual Decorators
  18. 98 Charms Upon Charms Decorators, practised with decorator factories
  19. 99 The Endless Well Generators and yield
  20. 100 Wells Without End Generators, practised with endless and chained wells
  21. 101 Forging a Familiar Classes and objects
  22. 102 The Hourglass of Sands Classes and objects, practised
  23. 103 The Cauldron Objects that hold collections
  24. 104 The Larder of Herbs Objects that hold collections, practised
  25. 105 The Familiar's True Name Special methods: __str__, __repr__, __eq__, __lt__
  26. 106 Ranking the Relics Special methods, practised
  27. 107 Lineages Inheritance and super()
  28. 108 The Familiar's Kin Inheritance and super(), practised
  29. 109 Casting Curses raise and custom exceptions
  30. 110 The Broken Seal raise and custom exceptions, practised
  31. 111 Guarded Attributes @property and setters
  32. 112 The Talisman's Glow @property and setters, practised
  33. 113 A Grimoire You Can Walk Making objects behave like containers
  34. 114 The Bestiary Objects that behave like containers, practised
  35. 115 The Archivist's Tools The collections module: Counter and defaultdict
  36. 116 The Augur's Ledger Counter and defaultdict, practised
  37. 117 Ledger Lines Formatting numbers and columns in f-strings
  38. 118 The Treasurer's Scroll Formatting numbers and columns, practised
  39. 119 The Magic Square Grids: lists of lists
  40. 120 The Rune Board Grids, practised
  41. 121 The Remembering Spiral Memoization and functools.lru_cache
  42. 122 The Oracle's Long Memory Memoization with lru_cache, practised
  43. 123 Seeking in the Sorted Stacks Binary search
  44. 124 The Index of Sealed Names Binary search, practised
  45. 125 Deciphering the Manifest Parsing structured text
  46. 126 The Register of Rites Parsing structured text, practised
  47. 127 Drawing Lots The random and math modules
  48. 128 The Scattering of Lots The random and math modules, practised
  49. 129 Sealing the Record The json module
  50. 130 Letters Under Seal The json module, practised
  51. 131 Reckoning the Calendar The datetime module
  52. 132 The Almanac of Moons The datetime module, practised
  53. 133 Paths Between Sanctums Graphs and breadth-first search
  54. 134 The Labyrinth Beneath Graphs and breadth-first search, practised
  55. 135 The Apothecary Combining classes, dictionaries and exceptions
  56. 136 The Familiar Stables Classes, dictionaries and exceptions, practised
  57. 137 The Ritual Simulator Combining classes, generators and state
  58. 138 The Night Watch Classes, generators and state, practised
  59. 139 The Archive Engine Capstone: a complete small system
  60. 140 The Familiar Registry Capstone: a second complete small system
JavaScript · 140 lessons · Beginner to advanced

JavaScript Basics

A hundred and forty lessons that take you from your first console.log() to classes, regular expressions, promises and async/await, in seven parts: the building blocks, then combining them while adding reduce, Map and Set, closures and classes, then the rest of the language a tool or two at a time, from switch and recursion to timers and asynchronous workings. Every lesson is followed by a practice lesson on the same tool. Xher teaches each one, every example is a small piece of ritual work, and the code is real JavaScript that runs right here in your browser.

Reader & Downloader members
Course outline 140 lessons in 7 parts
Part I · The First Workings Lessons 1–20
  1. 1 The First Incantation console.log()
  2. 2 The Herald's Proclamation console.log(), practised
  3. 3 Binding Names let and const
  4. 4 The Shifting Tally let and const, practised
  5. 5 Runes of Text Strings and .length
  6. 6 The Name Upon the Seal Strings and .length, practised
  7. 7 Measures of the Cauldron Numbers and arithmetic
  8. 8 The Alchemist's Balance Numbers and arithmetic, practised
  9. 9 Woven Words Template literals
  10. 10 The Familiar's Record Template literals, practised
  11. 11 Shaping the Runes String methods
  12. 12 The Scribe's Cleansing String methods, practised
  13. 13 Omens of Truth Booleans and comparisons
  14. 14 Scales of Judgement Booleans and comparisons, practised
  15. 15 The Forked Path if, else if, else
  16. 16 The Merchant's Fork if, else if, else, practised
  17. 17 Binding Wards &&, || and !
  18. 18 The Vault of Three Locks &&, || and !, practised
  19. 19 A Shelf of Reagents Arrays
  20. 20 The Restocked Shelf Arrays, practised
Part II · Rituals and Grimoires Lessons 21–40
  1. 21 The Repeating Chant for loops
  2. 22 The Descending Stair for loops, counting down and by steps
  3. 23 Walking the Shelf for...of and running totals
  4. 24 The Tithe of the Altar for...of and running totals, practised
  5. 25 Until the Seal Breaks while loops
  6. 26 The Halving Curse while loops, practised
  7. 27 Crafting a Ritual Functions and return
  8. 28 The Measure of a Potion Functions and return, practised
  9. 29 Offerings and Defaults Parameters, defaults and returned text
  10. 30 The Crier's Summons Parameters, defaults and returned text, practised
  11. 31 The Swift Glyph Arrow functions
  12. 32 Glyphs Swift and Full Arrow functions, practised
  13. 33 The Grimoire Entry Objects
  14. 34 The Raven's Record Objects, practised
  15. 35 Reading the Grimoire Object.entries and join
  16. 36 The Apothecary's Tally Object.entries, Object.values and join, practised
  17. 37 Rituals over Lists map and filter
  18. 38 Sifting the Familiars map and filter, practised
  19. 39 The Closing of the Circle Bringing it all together
  20. 40 The Gathering of Dues Combining Part II, practised
Part III · Combining the Workings Lessons 41–60
  1. 41 The Sigil Grid Nested loops and repeat()
  2. 42 The Woven Border Nested loops and repeat(), practised
  3. 43 Breaking the Chant break and continue
  4. 44 Sifting the Night's Signs break and continue, practised
  5. 45 The Rune Lattice Arrays of arrays
  6. 46 The Scrying Grid Arrays of arrays, practised
  7. 47 Wards at the Threshold Guard clauses and helper functions
  8. 48 The Warden's Rules Guard clauses and helper functions, practised
  9. 49 Seeking in the Stacks find, some and every
  10. 50 Calling the Roll find, findIndex, some and every, practised
  11. 51 Distillation reduce()
  12. 52 The Alchemist's Distillery reduce(), practised
  13. 53 Ordering the Shelves sort() and copying arrays
  14. 54 The Order of Precedence sort() and copying arrays, practised
  15. 55 Scattering and Gathering Spread and rest
  16. 56 Gathering the Circle Spread and rest, practised
  17. 57 Unpacking the Satchel Destructuring
  18. 58 Letters Under Seal Destructuring, practised
  19. 59 The Apothecary's Ledger Combining Part III
  20. 60 The Coven's Treasury Combining Part III, practised
Part IV · The Deeper Arts Lessons 61–80
  1. 61 Tallying Omens Counting with objects
  2. 62 The Augur's Census Counting with objects, practised
  3. 63 The Sealed Registry Map and Set
  4. 64 The Guest Ledger of the Sabbat Map and Set, practised
  5. 65 Scribing Tables split, Number and padding
  6. 66 Columns of the Almanac split, Number and padding, practised
  7. 67 Nested Grimoires Optional chaining ?.
  8. 68 Halls of the Deep Archive Optional chaining, practised
  9. 69 When Rituals Fail throw, try, catch and finally
  10. 70 The Cracked Cauldron throw, try, catch and finally, practised
  11. 71 Sealed Vessels Closures
  12. 72 The Hourglass Keepers Closures, practised
  13. 73 Rituals That Take Rituals Higher-order functions
  14. 74 The Ritual Forge Higher-order functions, practised
  15. 75 The Familiar's Blueprint Classes
  16. 76 The Coven's Roll Classes, practised
  17. 77 Lineage of Spirits extends, super and getters
  18. 78 Heirs of the Flame extends, super and getters, practised
  19. 79 The Grand Grimoire Bringing it all together
  20. 80 The Moonlit Bazaar Bringing Part IV together, practised
Part V · Sharper Tools Lessons 81–100
  1. 81 The Many Doors switch
  2. 82 The Wheel of Signs switch, practised
  3. 83 Truth in Disguise Truthy, falsy and logical defaults
  4. 84 The Unset Altar Truthy, falsy and logical defaults, practised
  5. 85 Shifting Forms Type conversion, typeof and NaN
  6. 86 The Assayer's Scales Type conversion, typeof and NaN, practised
  7. 87 The Alchemist's Arithmetic Math and the trouble with decimals
  8. 88 The Clamp and the Crucible Math and decimals, practised
  9. 89 Reshaping the Shelf slice, splice, indexOf and at
  10. 90 Mending the Scroll Rack slice, splice, indexOf and at, practised
  11. 91 Folding the Scrolls flat, flatMap, Array.from and Object.fromEntries
  12. 92 The Unfurled Atlas flat, flatMap, Array.from and Object.fromEntries, practised
  13. 93 Runes Within Runes More string methods
  14. 94 The Scribe's Cipher Marks More string methods, practised
  15. 95 Draw Until the Card Appears do...while, for...in and the in operator
  16. 96 The Next Auspicious Day do...while, for...in and the in operator, practised
  17. 97 The Copying Curse References, copies and freezing
  18. 98 The Twin Grimoires References, copies and freezing, practised
  19. 99 The Spoken Commands Combining Part V
  20. 100 The Purse That Listens Combining Part V, practised
Part VI · Patterns of Power Lessons 101–120
  1. 101 The Recursive Mirror Recursion
  2. 102 The Echoing Well Recursion, practised
  3. 103 Descending the Lineage Recursion over nested data
  4. 104 The Nested Reliquary Recursion over nested data, practised
  5. 105 Patterns in the Text Regular expressions
  6. 106 The Sigil Sieve Regular expressions, practised
  7. 107 Capturing Glyphs Regex groups, matchAll and replace
  8. 108 Glyphs in the Margin Regex groups and replace, practised
  9. 109 Sealing the Scroll JSON
  10. 110 The Sealed Correspondence JSON, practised
  11. 111 Telling the Hours Dates
  12. 112 The Wheel of Festivals Dates, practised
  13. 113 Endless Wells Generators and iterables
  14. 114 The Unending Procession Generators, practised
  15. 115 Secrets of the Order Static members and private fields
  16. 116 The Sealed Vault Static members and private fields, practised
  17. 117 The Bound Lantern Setters, guards and this
  18. 118 The Steady Flame Setters, guards and this, practised
  19. 119 The Spirit Registry Combining Part VI
  20. 120 The Almanac of Rites Combining Part VI, a second working
Part VII · The Turning of Time Lessons 121–140
  1. 121 The Turning Hours setTimeout, setInterval and the event loop
  2. 122 The Hourglass Bells Timers and the event loop, practised
  3. 123 Promises Kept Promises, then and catch
  4. 124 Chains of Promise Promises and then chains, practised
  5. 125 Awaiting the Omens async and await
  6. 126 The Patient Scribe async and await, practised
  7. 127 Many at Once Promise.all, allSettled and race
  8. 128 Messengers to Every Village Promise.all, allSettled and race, practised
  9. 129 Patience and Persistence Retries and timeouts
  10. 130 The Stubborn Echo Retries and timeouts, practised
  11. 131 Named Misfortunes Custom error classes
  12. 132 A Taxonomy of Curses Custom error classes, practised
  13. 133 Your Own Rituals Writing reusable utilities
  14. 134 The Alchemist's Toolkit Reusable utilities, practised
  15. 135 The Summoning Bell Events and listeners
  16. 136 The Whispering Gallery Events and listeners, practised
  17. 137 The Oracle's Memory Memoization
  18. 138 The Scribe's Cache Memoization, practised
  19. 139 The Final Conclave Bringing it all together
  20. 140 The Moonlit Courier Guild Bringing it all together, once more
TypeScript · 140 lessons · Beginner to advanced

TypeScript Basics

One hundred and forty lessons of TypeScript, from beginner to advanced. TypeScript is the warded tongue: JavaScript with a ward written onto every name, so the type warden can read your spell and refuse a mistake before it is ever spoken. Part I is the warded script: your first spell, names and their types, numbers and text, typed functions, decisions, union types, arrays, loops and object types. Part II shapes the forms: interfaces and type aliases, null and undefined, tuples and enums, functions in depth, the array methods, discriminated unions, classes, generics and the utility types. Part III binds the spellbook: narrowing and type guards, objects and constants, errors and result types, text and patterns, unknown input made safe, overloads, classes in depth, walking objects with keyof, and promises with async and await. Part IV, the first of the intermediate lessons, weaves the wards: generics in depth, mapped, conditional and template literal types, precisely typed helpers, validation with assertion functions and branded types, fluent classes and async patterns. Part V opens the deep grimoire: recursive types, how the warden decides what fits, intersections and mixins, generators, state machines and reducers, tuple types, typed registries, errors as data, and data structures of your own. Part VI, the first of the advanced lessons, unseals the codex: variance and inference, computing with types, typed format strings, decorators, symbols, concurrency, schemas that infer their types, and the static side of classes. Part VII is the master's codex: parser combinators and an interpreter, event sourcing, a typed store, algorithms, type-level queries, scheduling, a test runner of your own and a typed plugin system. Every lesson is followed by a practice lesson on the same tool. Xher teaches each one, and your code is checked by the real TypeScript compiler and run right here in your browser.

Reader & Downloader members
Course outline 140 lessons in 7 parts
Part I · The Warded Script Beginner Lessons 1–20
  1. 1 The Warden at the Threshold console.log(), text and numbers, and the type warden
  2. 2 The Proclamation Under Seal console.log(), practised: several pieces, empty lines and quotes
  3. 3 Names Bound Under Ward let and const with type annotations: string, number, boolean; inference
  4. 4 The Vault-Keeper's Honest Tally let and const with types, practised: values built from other values
  5. 5 The Arithmetic of Carved Runes Numbers and text: operators, Math, template literals and string methods
  6. 6 The Scribe's Measured Incantation Numbers and text, practised: indexOf, slice, includes and toFixed
  7. 7 Rites With Sealed Arguments Functions: typed parameters, return types and void
  8. 8 The Ferryman's Sealed Reckoning Functions, practised: functions that call functions, returning instead of printing
  9. 9 The Warden's Forked Path Decisions: if / else if / else, comparisons and && || !
  10. 10 The Gatekeeper's Ledger of Tolls Decisions, practised: rules that depend on several conditions
  11. 11 The Rune of Two Natures Union and literal types, and narrowing with typeof and ===
  12. 12 The Seal-Reader's Judgement Unions and literal types, practised: three natures and literal return types
  13. 13 The Rack of Sealed Vials Arrays: string[] and Array<number>, indexing, push and pop, includes, for...of, readonly
  14. 14 The Locked Cabinet's Inventory Arrays, practised: reading readonly arrays and building new ones
  15. 15 The Turning of the Prayer Wheel Loops: for with a counter, while, break and continue, nested loops
  16. 16 The Bellringer's Long Night Loops, practised: while loops that run until a rule is met, nested searches, building rows
  17. 17 The Familiar's Bound Description Object types: properties, optional ? and readonly, objects passed to functions
  18. 18 The Roll of the Sworn Coven Object types, practised: arrays of objects, optional and readonly properties together
  19. 19 The Grand Ledger of Wards Part I capstone: typed functions over an array of objects with a literal-union field
  20. 20 The Reckoning of the Warded Vault Part I capstone, practised: a ledger with a union-typed field, searches and a report
Part II · The Shaping of Forms Beginner Lessons 21–40
  1. 21 The Moulds of Named Form Type aliases and interfaces: naming the shape of an object, and extending one shape into another
  2. 22 The Coven's Register of Forms Type aliases and interfaces, practised: moulds that use other moulds, and workings that return new records
  3. 23 The Empty Vessel and the Absent Name null and undefined under strict checking: optional values, narrowing, ?. and ??, optional parameters
  4. 24 The Ledger of Missing Pages null and undefined, practised: null for a deliberate nothing, optional properties, find, ?. and ??
  5. 25 The Paired Sigils and the Numbered Tides Tuples and enums: fixed-length typed pairs, destructuring, numeric and string enums, and as const
  6. 26 The Tide-Table of the Harbour Witches Tuples and enums, practised: a string enum, labelled tuples, a literal union made with as const, and parsing words into enum members
  7. 27 The Rites With Room to Spare Functions in depth: default and optional parameters, rest parameters, arrow functions, function types and typed callbacks
  8. 28 The Chain of Small Workings Functions in depth, practised: a function type for string charms, defaults and rest parameters, and looking up functions by name
  9. 29 The Sieve, the Lens and the Crucible Typed array methods: map, filter, reduce with an initial value, find and its | undefined, some, every, sort with a compare function, chaining
  10. 30 The Assay of the Apothecary's Shelves Typed array methods, practised: reduce to a total and to a best element, some and every, sorting by two keys, and chaining into a report
  11. 31 The Three Shapes of the Summoning Circle Discriminated unions: a kind field of literal types, switch over it, narrowing in each case, and exhaustiveness checking with never
  12. 32 The Ritual Engine of Many Commands Discriminated unions, practised: commands as a union, an engine that applies each one to a state without changing it, and reduce over the commands
  13. 33 The Familiar Bound in a Class Classes: typed fields, constructors, methods and this, parameter properties, public, private and readonly, and implementing an interface
  14. 34 The Vault of the Guarded Coffers Classes, practised: private state guarded by methods that refuse bad requests, a default constructor parameter, an interface, and one class that holds instances of another
  15. 35 The Vessel That Takes the Shape of Its Contents Generics: generic functions with a type parameter T, inference of T, generic interfaces and types, constraints with extends, and keyof
  16. 36 The Shelf of Many-Shaped Jars Generics, practised: a generic class, a generic method with its own type parameter, callbacks typed by T, and generic workings over two types
  17. 37 The Ledger Keyed by Name Records and collections: Record and index signatures, typed Map and Set, and the utility types Partial, Readonly, Pick and Omit
  18. 38 The Census of the Night Market Records and collections, practised: a Map that grows and shrinks, a Set of banned goods, a Record of prices with missing keys, and Readonly, Omit and Partial together
  19. 39 The Warden's Book of the Midnight Fair Part II capstone: a discriminated union of entries kept in a class, totals in a Map, a generic helper, an optional parameter and a tuple result
  20. 40 The Last Rite of the Shaping of Forms Part II capstone, practised: a lending library built from interfaces, an optional property, a union of events handled exhaustively, a class with Map and Set state, and a generic Record counter
Part III · The Bound Spellbook Beginner Lessons 41–60
  1. 41 The Sieve of Telling Shapes Narrowing in depth: the in operator, instanceof, truthiness and equality, and type guards that teach the warden a test
  2. 42 The Customs House of the Night Ferry Narrowing, practised: one union of numbers, strings, arrays, plain objects and class instances, sorted with typeof, Array.isArray, instanceof, in and a guard
  3. 43 The Unfolding of the Sealed Satchel Objects in depth: destructuring with types and defaults, spread and rest, copying instead of changing, as const, readonly arrays and keyof typeof
  4. 44 The Quartermaster's Folded Kits Objects in depth, practised: readonly kits copied and merged with spread, destructured options with defaults, and a sealed table of weights
  5. 45 The Ward That Catches Falling Stars Errors: throw, try/catch/finally, the caught value is unknown, Error subclasses with typed fields, and result unions instead of throwing
  6. 46 The Assayer's Ledger of Failed Trials Errors, practised: a parser that throws its own error class, a generic result wrapper that catches only that class, and a ledger that collects every failure
  7. 47 The Scribe's Knife and Lens Text work with types: split, join, replace and replaceAll, padStart, padEnd and repeat, RegExp with match and test, and Number, parseInt and Number.isNaN
  8. 48 The Herald's Decoded Proclamations Text work, practised: reading a small line format with regex groups, normalising what was read, and printing an aligned report with padStart and padEnd
  9. 49 The Stranger at the Gate unknown, any and assertions: why any switches the warden off, narrowing unknown, the danger of as, satisfies, and validating JSON.parse output with a type guard
  10. 50 The Customs Seal on Foreign Scrolls unknown, practised: validating a whole JSON roster without any or as, with a precise message for every fault and optional fields given defaults
  11. 51 The Many Mouths of One Oracle Function signatures in depth: function type aliases, methods and optional methods in interfaces, overloads with one implementation, and void callbacks
  12. 52 The Bell-Tower's Register of Callers Function signatures, practised: a typed listener registry with unsubscribe functions, a callable interface with a method, and overloads that change the shape of the answer
  13. 53 The Lineage of the Wardstones Classes in depth: extends and super, protected, abstract classes and methods, override, static members, and getters and setters that guard a value
  14. 54 The Menagerie of the Iron Bestiary Classes in depth, practised: an abstract base with abstract and shared methods, three subclasses that override and extend, a private static registry, and a guarded setter
  15. 55 The Census of Every Chamber Walking objects: Object.keys, values and entries and why keys are strings, keyof and indexed access types, and walking a Record with a typed list of its keys
  16. 56 The Tithe-Barn's Tallies Walking objects, practised: complete and partial Records with a union key, records nested by a second key, ranking by values, and a generic keyof helper that takes a scoring callback
  17. 57 The Messenger Who Returns at Dusk Promises and async: Promise<T>, async and await and their return types, delays with setTimeout, Promise.all with typed tuples, and catching rejections
  18. 58 The Caravan of Slow Couriers Async, practised: an async courier that rejects with its own error class, dispatching one after another versus all at once, and collecting successes and failures without losing either
  19. 59 The Archive Warden's Night Ledger Part III capstone: unknown JSON turned into tasks of an abstract class with guards, each run against a Record and reporting a result union, worked through in order with async waits
  20. 60 The Grand Inventory of the Sunken Vault Part III capstone, practised: relics read from unknown JSON into an abstract class hierarchy, appraised all at once with a custom error for the cursed, totalled in a Record and reported in ranked order
Part IV · The Woven Wards Intermediate Lessons 61–80
  1. 61 The Satchel That Remembers What It Carries Generics in depth: several type parameters, K extends keyof T, default type parameters, generic classes, and explicit type arguments
  2. 62 The Oracle Who Forgets the Oldest Question Generics, practised: a generic interface with methods, a generic class that implements it with a capacity, and a generic index keyed by one property
  3. 63 The Glass That Reshapes Every Ward Mapped types: { [K in keyof T]: ... }, readonly and ? with + and -, writing Partial, Required, Readonly and Record yourself, and mapping values to validators
  4. 64 The Ledger of Mirrored Changes Mapped types, practised: Nullable, Flags, Draft and Changes, and generic functions that compute, apply and describe the differences between two records
  5. 65 The Fork in the Warden's Road Conditional types: T extends U ? X : Y, distribution over unions, infer, and writing Exclude, Extract and NonNullable yourself
  6. 66 The Sieve of the Sorting Spirits Conditional types, practised: infer on parameter lists and tuples, recursive conditional types, filtering keys by their value type, and implementing functions whose types are conditional
  7. 67 The Runes Spelled From Lesser Runes Template literal types: building string unions, Capitalize and Uppercase, key remapping with as in mapped types, and validating text into a template type
  8. 68 The Herald's Book of Named Callings Template literal types, practised: a typed event herald whose event names and payloads come from one map type, unsubscribing, and onX handler props built by key remapping
  9. 69 The Glove That Fits Any Hand Typing higher-order functions: Parameters, ReturnType and Awaited, and generic wrappers (...args: A) => R that keep a function's exact signature
  10. 70 The Thrice-Tried Incantation Higher-order functions, practised: retrying a failing function, piping one function into another, counting calls, and guarding with a fallback, all keeping exact signatures
  11. 71 The Seal-Tester at the Archive Gate Validating the outside world: assertion functions (asserts value is T), composable guard builders, isShape over a mapped type, and branded types for ids
  12. 72 The Customs House of Foreign Scrolls Validation, practised: parsing unknown JSON into a precise type with a branded id, collecting every error with its path, and a result union the caller must check
  13. 73 The Builder Who Answers Itself this and overloads: this parameters, fluent methods that return this (and keep a subclass's type), overloaded functions with generics, and which callbacks fit a callback type
  14. 74 The Scribe Who Chains the Sentences this and overloads, practised: a generic fluent query over a list (where, orderBy, limit), typed selection with Pick, an overloaded method, and a subclass that pages through results
  15. 75 The Archive Built on a Hidden Foundation Class patterns: #private fields, implementing several interfaces, a generic abstract base class, private constructors with static factories, and composition over inheritance
  16. 76 The Guild Hall of Interchangeable Crafts Class patterns, practised: composition of an inventory and pluggable pricing rules behind interfaces, #private state, a private constructor with a static factory, and choosing the best rule
  17. 77 The Messengers Who May Not Return Async patterns: Promise.allSettled and narrowing its results, timeouts with Promise.race, retrying with backoff, and async generators read with for await
  18. 78 The Courier Guild's Night Ledger Async patterns, practised: a typed job queue that runs one job at a time in order, survives failures and reports when idle, and concurrent deliveries each under a time limit
  19. 79 The Orrery of the Woven Wards Part IV capstone: branded ids and an assertion function at the gate, a generic ledger, typed listeners built from an event map with template literal keys, and concurrent work with allSettled
  20. 80 The Last Bell of the Midnight Market Part IV capstone, practised: parsing order lines into branded types, a market made by a static factory with typed events, template-literal tallies, and concurrent deliveries under a time limit
Part V · The Deep Grimoire Intermediate Lessons 81–100
  1. 81 The Root That Remembers Every Branch Recursive types: a Json type, trees of any value, recursive functions over them, and DeepReadonly and DeepPartial built from mapped types that refer to themselves
  2. 82 The Archive of Scrolls Within Scrolls Recursive types, practised: dotted key paths and the value at a path as types, a typed getPath, measuring any Json value, and freezing a value to DeepReadonly
  3. 83 The Lamp That Fits Every Sconce Structural typing and assignability: shapes without implements, excess property checks on fresh literals, readonly arrays, function assignability, unknown as the top type and never as the bottom
  4. 84 The Warden's Measure of Kinship Assignability, practised: handlers that accept more fit where fewer are expected, a generic dispatcher, exhaustive checks with never, unknown values turned into text, and satisfies that checks without forgetting
  5. 85 The Graft of Twin Natures Intersection types: A & B, merging objects with precise types, conflicts that become never, and class mixins that graft new powers onto any class
  6. 86 The Golem of Borrowed Gifts Intersections, practised: turning a union into an intersection, assembling an object from any number of parts with an exact type, and mixins constrained to the classes they can work on
  7. 87 The Bottomless Reliquary Iterables and generators: Iterable<T> and Iterator<T>, implementing [Symbol.iterator], Generator<T, TReturn, TNext>, lazy pipelines over any iterable, and generators that receive values through next
  8. 88 The River That Flows Only When Drawn Iterables, practised: a reusable lazy pipeline class with map, filter (narrowing through a type guard), take, chunk, first and toArray, working on endless sources and pulling only what is needed
  9. 89 The Cauldron's Turning Seasons State machines and reducers: states and actions as discriminated unions, deriving the action type from a map of payloads, a typed transition table, and a reducer with exhaustive switches
  10. 90 The Chronicle That Can Unwrite Itself Reducers, practised: an immutable account reducer over a payload map, a typed action maker built with Extract, and a generic History with undo and redo that works for any state and action
  11. 91 The Rosary of Counted Beads Tuples at the type level: as const arrays as unions, labelled and optional elements, readonly tuples, Head/Tail/Last/Length with infer, and variadic tuple types
  12. 92 The Alchemist's Half-Spoken Formulae Tuples at the type level, practised: partial application and currying with variadic tuples, recursive Reverse and Zip types, and unions taken from as const tables
  13. 93 The Keeper of the Summoned Servants Typed registries: services keyed by name with a map type M, get<K extends keyof M>(key): M[K], lazy factories with caching, and factories that ask for other services
  14. 94 The Guildhall Raised From Declared Crafts Typed registries, practised: plugins that declare what they provide and need, Pick<M, Need> so an undeclared dependency is a type error, and assembling them in dependency order with missing and circular needs reported
  15. 95 The Ledger That Records Every Refusal Errors as data: a Result<T, E> union with ok/err constructors, map, flatMap, unwrapOr, match and all, typed error unions, never-returning fail, and Error with a cause
  16. 96 The Apothecary's Book of Rejected Orders Errors as data, practised: validating unknown orders into a Result with a typed error union, describing every error exhaustively, the first failure with its position, and Error with a cause
  17. 97 The Heap Where the Urgent Rise Generic data structures: a binary-heap PriorityQueue<T> with a comparison, Dijkstra's cheapest paths over a typed graph of named towns, NoInfer, and why the naive versions are too slow for large inputs
  18. 98 The Cartographer's Atlas and Word-Hoard Generic data structures, practised: a typed undirected RoadAtlas<N> with fewest-roads search and a cost budget, and a prefix tree for fast word counts and completions, both fast on large inputs
  19. 99 The Scriptorium's Night of Commissions Part V capstone: commissions validated from unknown JSON into Results, a job state machine driven by actions derived from a payload map, a priority queue setting the night's order, and a generator writing the ledger
  20. 100 The Guild of the Hundredth Bell Part V capstone, practised: a command language parsed into payload-map commands with Results, a typed handler table, a guild whose idle members wait in a priority queue, quests ticking to completion, and a generator for the guild's report
Part VI · The Sealed Codex Advanced Lessons 101–120
  1. 101 The Scales That Weigh Both Ways Variance and inference control: covariance and contravariance, method vs function-property checks, in/out variance annotations, const type parameters and NoInfer
  2. 102 The Keepers' Chain of Narrow Gates Variance, practised: Reader<out T> and Writer<in T> served by one Channel class, forwarding without losing a value, dealing values in rotation, and const plus NoInfer in a typed tally
  3. 103 The Abacus Strung With Empty Beads Type-level computation: recursive conditional types, counting with tuples (BuildTuple, Add, Range), parsing strings at the type level (Trim, Split, Join), and route parameters extracted from a pattern
  4. 104 The Cartographer of Optional Roads Type-level computation, practised: optional route parameters split into required and optional unions and flattened into one object type, kebab-case to camelCase at the type level, and matching and building paths to match
  5. 105 The Scribe Who Reads the Formula Before the Ink Typed format strings and mini DSLs: argument tuples computed from a format string, a %% escape, a wide-string fall-back, and an event name parsed into its parts at the type level
  6. 106 The Herald's Book of Named Blanks Typed templates, practised: named placeholders with kinds read into an object type, conflicts that become never, a compiled template, the names it holds, and the filled sentence computed at the type level
  7. 107 The Seals Pressed Upon the Rite Decorators: method, field and class-member decorators, the context object, replacing a method, initialisers for fields, decorator factories, addInitializer, and typing a decorator so it fits only the right members
  8. 108 The Wardens Set Upon Every Door Decorators, practised: accessor decorators that guard a setter, call counting keyed by class and method, once-only methods, stacked decorators, and a class decorator that registers zero-argument classes for creation by name
  9. 109 The Sigil No Second Hand Can Draw Symbols and protocols: unique symbol types, symbol-keyed properties, brands made from a unique symbol, Symbol.iterator, Symbol.asyncIterator with for await, Symbol.toPrimitive and Symbol.toStringTag on a class
  10. 110 The Reliquary of Hidden Notes and Turning Hours Symbols and protocols, practised: notes hidden under a unique symbol key with a type guard that narrows by it, one class that is both Iterable and AsyncIterable, interleaving several async iterables in turn, and stopping a for await early
  11. 111 The Hourglass That Counts Its Bearers Concurrency on the virtual clock: a cancellation token of your own, a sleep that can be cancelled, and a concurrency limiter whose wrapper keeps the wrapped function's exact signature
  12. 112 The Narrow Bridge of Laden Carts Concurrency, practised: a typed channel with backpressure, an order-keeping mapLimit, and a throttle that keeps its arguments' types
  13. 113 The Mould That Reads Its Own Shape Schemas that infer types: small validators (literal, arr, optional, obj) built on one Schema<T> interface, Infer<S> with infer, optional keys found by a mapped type, and issues reported with their paths
  14. 114 The Assay-Moulds of the Covenant Rolls Schemas, practised: union over a tuple of schemas, refine, transform that changes the inferred type, record, and defaults that keep a key required in the output type
  15. 115 The Bestiary of Bound Summonings The static side of classes: typeof Class, constructor types new (...args: A) => T, InstanceType and ConstructorParameters, abstract constructor types for instanceof, this-typed static factories, and a registry of classes keyed by name
  16. 116 The Reliquary of Waking Relics The static side of classes, practised: static members described by an interface (tag, revive, prototype), a private constructor with a generic static factory whose type is read from the classes given, a this-typed static forge, and abstract constructor types
  17. 117 The Folded Leaves of the Single Grimoire Namespaces and declaration merging in one script: namespace with export (and nested namespaces), merging interfaces, function + namespace, enum + namespace, class + namespace, overloads across merged interfaces, declare for values the world provides, and global augmentation (and why it should be rare)
  18. 118 The Almanac Bound From Scattered Leaves Merging, practised: an interface merged from several declarations used as an extensible registry with a generic perform, a class merged with a namespace of types, constants and a parser, overloads merged with a namespace, and a string enum whose namespace helpers must be told apart from its members
  19. 119 The Gatehouse Where Every Road Is Named Part VI capstone: a typed gatehouse whose route strings are parsed at the type level into handler parameters, with schema-checked bodies, generic routes kept in closures with one plain signature, a concurrency limit shared by every road, and symbol-branded request ids
  20. 120 The Tollhouse at the Edge of the Codex Part VI capstone, practised: a tollhouse with GET and POST roads, route names parsed at the type level, schema-checked bodies, a shared lane limit, a cancellation token and a patience timer per request (cleared when done), 408/500 replies, an iterable log through Symbol.iterator, and a tally typed by status
Part VII · The Master's Codex Advanced Lessons 121–140
  1. 121 The Loom of Little Readers Parser combinators: Parser<T> as a function type, str and regex, map, seq inferring a tuple with variadic generics, alt inferring a union, many, sepBy and lazy, and remembering the furthest failure
  2. 122 The Reckoner of Nested Measures Parser combinators, practised: an arithmetic grammar with five levels of precedence, left- and right-associative operators and a unary minus, parsed into a typed AST, then shown and evaluated, with errors at the furthest point
  3. 123 The Engine That Reads Its Own Runes An interpreter: values as a union with closures, nested environments, an evaluator over a discriminated-union AST with lexical scope and recursion, runtime errors as Results, and a step budget that stops runaway programs
  4. 124 The Scribe Who Forges the Engine's Eyes An interpreter, practised: a hand-written tokenizer (keywords, names, numbers, longest-match symbols, comments) and a recursive-descent parser with precedence, left-associative loops, call chains and exact error positions, feeding the evaluator
  5. 125 The Chronicle From Which the Vault Is Remade Event sourcing: events derived from a payload map, a typed table of appliers, state as a fold over history, commands checked against invariants before an event is accepted, replaying to any version, and snapshots so the past is cheap
  6. 126 The Lending Rolls of the Undying Library Event sourcing, practised: a library of books and members as events, invariants across two kinds of record, mutable replay from defensive snapshot copies every hundred events, projections kept up to date as events arrive, and history queries fast enough for a hundred thousand events
  7. 127 The Ledger-Keeper and Its Obedient Familiars A typed store: a reducer over a union of actions, getState/dispatch/subscribe with unsubscribe, a middleware chain built with reduceRight (outermost first, re-entrant dispatch), and memoised selectors whose input tuple is inferred from the selector functions
  8. 128 The Gate Whose Wards Grow With Every Step Typed store middleware, practised: an immutable pipeline whose context type accumulates fields step by step (Gate<Ctx & Out>), refusals through a never-returning function, compile-time refusal of steps that need missing fields or overwrite existing ones, checks, a trail, and handlers typed by the final context
  9. 129 The Four Engines of the Reckoning Hall Algorithms with types: a generic union-find (path compression and union by size), Kahn's topological order with a cycle reported as data and NoInfer keeping edges to known nodes, a generic memoize with a typed cache, and binary search on the answer; inputs large enough that the naive versions run out of time
  10. 130 The Guild Surveyor's Four Commissions Algorithms with types, practised: Kruskal's cheapest network over a union-find with towns typed by NoInfer, a schedule of earliest finishes over a dependency plan whose task names are inferred from its keys (or the cycle that blocks it), edit distance with a rolling table, and binary search on the answer for the widest spacing; large inputs that only the efficient ways can answer in time
  11. 131 The Query-Glass of the Familiar Rolls Type-level programming in earnest: parsing a query string at the type level into the row type it selects, with tail-recursive conditional types and errors as types
  12. 132 The Lexicon of the Ordered Columns Type-level query parsing, practised: aliases with as, order by with desc, intersections simplified into one row, refusing an invalid query at the call with a conditional rest parameter, and a run-time engine that agrees with the types
  13. 133 The Metronome of the Measured Gate Scheduling on the virtual clock: a seeded random generator, jittered exponential backoff, a token-bucket rate limiter, and calls spaced a fixed time apart, all with precise generic types
  14. 134 The Forge-Master's Docket of Waiting Work Scheduling, practised: a scheduler on the virtual clock running one job at a time by priority, with delays, per-job timeouts, cancellation that reaches the running job through a signal, and exact types for every job's result
  15. 135 The Assessor's Book of Trials Testing tools: a tiny test runner with typed expect(x) matchers (toBe, deep toEqual, not, toThrow only for functions, resolves only for promises), assertion errors with clear messages, and async tests run in order
  16. 136 The Augur's Thousand Questions Property-based testing, practised: seeded arbitraries Arb<T> for integers, choices, arrays, tuples and records with exactly inferred types, a forAll runner, and greedy shrinking of a failing case to a minimal one
  17. 137 The Guild-Charter of Joined Crafts A typed plugin system: plugins declaring what they need and what they give, an app builder whose type accumulates every capability, needs checked at compile time through parameter variance, and a start/stop lifecycle in order
  18. 138 The Founding of the Lantern-Wrights' Hall A typed plugin system, practised: asynchronous start and stop, rolling back already-started plugins when one fails, refusing at compile time both unmet needs and a capability given twice, all with a builder typed without assertions
  19. 139 The Tongue That Wakes Within the Codex Final capstone: a small scripting tongue -- a parser-combinator front end into a typed syntax tree, an interpreter with a chain of scopes, errors as outcomes, a step budget, and built-ins whose parameters are typed by the warden
  20. 140 The Master's Codex Spoken Whole Final capstone, practised: the tongue grows functions -- extending the grammar with fn, return and call statements, closures that capture their scope, returns as signals, a call-depth limit, and a built-in helper whose tags the warden checks against each parameter
SQL · 140 lessons · Beginner to advanced

SQL Basics

One hundred and forty lessons that take you from your first SELECT to the advanced arts. Part I teaches you to read the archive's ledgers, Part II to shape and join them, Part III to query more deeply, and Part IV to build and keep a database well. Part V names its workings with CTEs, recursion and window functions, Part VI brings the archive to life with triggers, JSON and full-text search, and Part VII masters the ledger: indexes, merges, history, pivots, audits and design. Every lesson is followed by a practice lesson on the same tool. Xher teaches each one, every query runs against a small database of keepers, familiars, spells and rituals, and the SQL is real SQLite that runs right here in your browser.

Reader & Downloader members
Course outline 140 lessons in 7 parts
Part I · Reading the Ledgers Lessons 1–20
  1. 1 The Ledger Opens SELECT and FROM
  2. 2 Reading the Familiar Rolls SELECT and FROM, practised
  3. 3 Weighing the Wares Column expressions and AS
  4. 4 The Keeper's Seal Column expressions and AS, practised
  5. 5 The Sieve of WHERE WHERE and comparisons
  6. 6 Omens Below the Line WHERE and comparisons, practised
  7. 7 Bound Conditions AND, OR and NOT
  8. 8 The Warden's Sifting AND, OR and NOT, practised
  9. 9 Ordering the Shelves ORDER BY
  10. 10 The Order of Precedence ORDER BY, practised
  11. 11 The Measured Draught LIMIT, OFFSET and DISTINCT
  12. 12 Pages from the Middle LIMIT, OFFSET and DISTINCT, practised
  13. 13 Patterns in the Ledger LIKE, IN and BETWEEN
  14. 14 The Scrivener's Sieve LIKE, IN and BETWEEN, practised
  15. 15 The Empty Vessel NULL, IS NULL and COALESCE
  16. 16 Ledger of the Unknown NULL and COALESCE, practised
  17. 17 Counting the Hoard COUNT, SUM, AVG, MIN, MAX and ROUND
  18. 18 The Tithe of Numbers Aggregates, practised
  19. 19 The Keeper's Report Combining Part I
  20. 20 The Apothecary's Inventory Combining Part I, practised
Part II · Shaping and Joining Lessons 21–40
  1. 21 Sorting the Archive into Heaps GROUP BY
  2. 22 The Rolls of Every Coven GROUP BY, practised
  3. 23 The Sieve After the Gathering HAVING
  4. 24 Two Sieves, One Working WHERE and HAVING, practised
  5. 25 Runes of Choosing CASE expressions
  6. 26 Tallies by Omen CASE inside aggregates, practised
  7. 27 Binding Two Tables INNER JOIN
  8. 28 The Leaders of the Rites INNER JOIN, practised
  9. 29 Those Left Unmatched LEFT JOIN
  10. 30 The Census of Bonds LEFT JOIN and counting, practised
  11. 31 The Three-Fold Binding Joining three tables
  12. 32 The Apothecary's Reckoning Joining three tables, practised
  13. 33 Questions Within Questions Subqueries
  14. 34 Nested Divinations Subqueries, practised
  15. 35 Inscribing the Ledger INSERT, UPDATE and DELETE
  16. 36 Tidying the Apothecary INSERT, UPDATE and DELETE, practised
  17. 37 Raising a New Table CREATE TABLE, constraints and DROP TABLE
  18. 38 The Roll of Apprentices CREATE TABLE, practised
  19. 39 The Ledger of the Wheel Bringing Part II together
  20. 40 The Final Reckoning of the Archive Bringing it all together, practised
Part III · Deeper Queries Lessons 41–60
  1. 41 Runes Reshaped String functions
  2. 42 The Scribe's Corrections String functions, practised
  3. 43 The Weighing of Coins Numbers: division, CAST, ROUND, ABS and %
  4. 44 Shares of the Gathering Numbers, practised
  5. 45 Reading the Almanac Dates: date(), strftime() and julianday()
  6. 46 The Wheel of Months Dates, practised
  7. 47 The Mirror Ledger Self-joins
  8. 48 Kindred Reflections Self-joins, practised
  9. 49 Ledgers Laid End to End UNION, UNION ALL, INTERSECT and EXCEPT
  10. 50 The Gathered Roll Set operations, practised
  11. 51 The Ledger Within the Ledger Subqueries in FROM and in the SELECT list
  12. 52 Measures Taken Twice Subqueries in FROM and in the SELECT list, practised
  13. 53 Questions That Look Back Correlated subqueries, EXISTS and NOT EXISTS
  14. 54 The Unanswered and the Unmatched Correlated subqueries and EXISTS, practised
  15. 55 Heaps of Every Shape Grouping by expressions, COUNT(DISTINCT) and grouped labels
  16. 56 The Almanac of Tallies Grouping by expressions and COUNT(DISTINCT), practised
  17. 57 The Keeper's Full Account Reports from several joined tables
  18. 58 The Grand Tally of Spells Reports from several joined tables, practised
  19. 59 The Reckoning of the Year Bringing Part III together
  20. 60 The Closing of the Third Ledger Bringing Part III together, practised
Part IV · Building and Keeping Lessons 61–80
  1. 61 Wards Upon the Table Constraints: NOT NULL, UNIQUE, CHECK and DEFAULT
  2. 62 The Roster of the Watch Constraints, practised
  3. 63 Threads Between Tables Foreign keys: REFERENCES and ON DELETE CASCADE
  4. 64 Severed Bonds Foreign keys, practised
  5. 65 Reshaping the Familiar Roll ALTER TABLE: ADD COLUMN, RENAME COLUMN and RENAME TO
  6. 66 The Ledger Renamed ALTER TABLE, practised
  7. 67 Moving the Old Rites INSERT ... SELECT, UPDATE and DELETE with subqueries
  8. 68 The Sealing of the Rare Stores Moving data, practised
  9. 69 Writing Without Doubling Upserts: INSERT OR IGNORE, INSERT OR REPLACE and ON CONFLICT DO UPDATE
  10. 70 The Tally of Sightings Upserts, practised
  11. 71 The Sealed Working Transactions: BEGIN, COMMIT and ROLLBACK
  12. 72 The Undone Hour Transactions with SAVEPOINT, practised
  13. 73 The Scrying Glass Views: CREATE VIEW
  14. 74 Glass Upon Glass Views, practised
  15. 75 Threads Through the Stacks Indexes: CREATE INDEX and CREATE UNIQUE INDEX
  16. 76 The Warden's Catalogue Indexes, practised
  17. 77 Untangling the Scroll Designing tables: one-to-many
  18. 78 The Web of Circles Designing tables: many-to-many, practised
  19. 79 The Pledge Vault Combining Part IV
  20. 80 The Last Seal of the Ledger Combining Parts III and IV, practised
Part V · The Named Workings Lessons 81–100
  1. 81 The Named Working Common table expressions (WITH)
  2. 82 Steps Given Names Common table expressions, practised
  3. 83 Steps Upon Steps Chained CTEs, and a step used twice
  4. 84 The Chain of Reckonings Chained CTEs, practised
  5. 85 The Endless Count WITH RECURSIVE: sequences and calendars
  6. 86 The Days Without Offering WITH RECURSIVE calendars, practised
  7. 87 The Descent of the Lineage WITH RECURSIVE over a hierarchy
  8. 88 The Climb to the Root WITH RECURSIVE over a hierarchy, practised
  9. 89 Places in the Procession Window functions: ROW_NUMBER, RANK and DENSE_RANK
  10. 90 The Ranks of the Devoted Window functions over grouped rows, practised
  11. 91 Heaps Within the Reckoning PARTITION BY
  12. 92 The Crowned of Every Coven PARTITION BY, practised
  13. 93 The Tally That Grows Running totals and window frames
  14. 94 When Tallies Tie Running totals and window frames, practised
  15. 95 Glances Behind and Before LAG, LEAD, FIRST_VALUE and LAST_VALUE
  16. 96 The Echo of the Next Rite LAG, LEAD and NTH_VALUE, practised
  17. 97 Bands of Standing NTILE, PERCENT_RANK, CUME_DIST and top-N per group
  18. 98 The Elders, the Middling and the Young NTILE, PERCENT_RANK, CUME_DIST and top-N per group, practised
  19. 99 The Weaving of Many Workings Bringing CTEs, recursion and window functions together
  20. 100 The Knot at the Loom's End CTEs, recursion and window functions, practised
Part VI · The Living Archive Lessons 101–120
  1. 101 The Chronicle That Writes Itself Triggers: AFTER INSERT, UPDATE and DELETE with NEW and OLD
  2. 102 The Purse That Counts Itself Triggers that keep a summary table, practised
  3. 103 The Gatekeeper Spirit Validation triggers: BEFORE, WHEN, UPDATE OF and RAISE(ABORT)
  4. 104 Wards That Answer Back Validation triggers and RAISE(IGNORE), practised
  5. 105 Scrolls Sealed in Braces JSON: json_extract, json_valid, json_object and json_group_array
  6. 106 The Cataloguer's Cards Building and changing JSON: json_object, json_set and json_remove, practised
  7. 107 Unfurling the Tags json_each: turning a JSON list into rows
  8. 108 Every Leaf of the Scroll json_tree, and json_each as a list of values, practised
  9. 109 Answers from the Writing Hand RETURNING, and generated columns
  10. 110 The Month Inscribed Itself RETURNING and generated columns, practised
  11. 111 The Unbending Ledger typeof() and STRICT tables
  12. 112 No Stray Kinds Admitted STRICT tables and typeof(), practised
  13. 113 Sieves Within the Tally FILTER, conditional aggregates, iif and ordered GROUP_CONCAT
  14. 114 Every Cell Its Own Sieve FILTER and ordered GROUP_CONCAT, practised
  15. 115 The Index of Whispers Full-text search with FTS4
  16. 116 Hunting Words in the Stacks Full-text search, practised
  17. 117 Unbroken Runs of Devotion Gaps and islands
  18. 118 The Calendar of Empty Altars Calendars and islands, practised
  19. 119 The Archive That Keeps Its Own Ledger Triggers, JSON, RETURNING, STRICT and FILTER together
  20. 120 The Book of Vows The living archive, practised
Part VII · Mastery of the Ledger Lessons 121–140
  1. 121 Indexes of Narrow Purpose Partial, expression and covering indexes
  2. 122 Wards Woven into the Catalogue Partial, expression and covering indexes, practised
  3. 123 The Twice-Told Omens Finding and removing duplicates
  4. 124 Sifting the Night Watch's Reports Cleaning and deduplicating, practised
  5. 125 Roads That Bend Back Recursive paths with cycle guards
  6. 126 The Shortest Road to Every Door Graph walks, practised
  7. 127 The Courier's Satchel Merging from a staging table
  8. 128 The Ashgrove Roll Reconciled Merging and reconciling, practised
  9. 129 The Ledger of Shifting Prices Temporal history: as-of queries and closing ranges with a trigger
  10. 130 Prices As They Stood Temporal history, practised
  11. 131 Turning the Ledger on Its Side Unpivot and crosstab reports
  12. 132 The Chequered Report Unpivot and crosstab reports, practised
  13. 133 The Window's Many Frames Window frames: RANGE with offsets, GROUPS and EXCLUDE
  14. 134 The Middle Measure Window frames, practised: the median
  15. 135 The Auditor's Lantern Integrity audits: orphans, duplicates and the pragmas
  16. 136 Mending the Torn Pages Integrity audits, practised: finding and mending
  17. 137 The Architecture of Wards Designing a small system: constraints, triggers and views together
  18. 138 The Cauldron Board Designing a small system, practised
  19. 139 The Great Working of the Archive Combining the advanced arts
  20. 140 The Keeper of the Grand Archive Combining the advanced arts, practised
C++ · 140 lessons · Beginner to advanced

C++ Basics

One hundred and forty lessons of C++, from beginner to advanced. C++ is the iron tongue: every spell must be forged by a compiler before it can act, so you learn exact types and careful steps from the start. Part I is the first forging: your first program, variables and types, arithmetic, reading input and making choices. Part II turns the wheel: loops, switch, functions, vectors and strings. Part III gives the iron its shapes: structs and classes, constructors, operators, maps and sorting, pointers and the heap. Part IV, the first of the intermediate lessons, tempers the steel: iterators, lambdas and the algorithms, tuples and queues, templates, inheritance, copying and moving, optional values and string streams. Part V sets the guild's engines turning: recursion and backtracking, grids and breadth-first search, namespaces and constexpr, operators and ordered containers in depth, more of the algorithms, composition, bits and flags, and shared ownership. Part VI, the first of the advanced lessons, descends into the deep foundry: perfect forwarding, variadic and compile-time templates, variants, iterators and algorithms of your own, graphs, dynamic programming, and the cost of memory and copies. Part VII is the master's anvil: owners, containers and hash tables built by hand, trees and range structures, design patterns and static polymorphism, algorithm design, and a virtual machine with a compiler of your own. Every lesson is followed by a practice lesson on the same tool. Xher teaches each one, and your code is compiled by a real C++ compiler right here in your browser.

Reader & Downloader members
Course outline 140 lessons in 7 parts
Part I · The First Forging Beginner Lessons 1–20
  1. 1 The First Strike of the Hammer The shape of a program: #include, main() and std::cout
  2. 2 The Smith's Proclamation std::cout, practised: chaining << and std::endl
  3. 3 Notes in the Margin of the Forge Comments, several outputs on a line, and escape sequences
  4. 4 The Inscribed Lintel Escape sequences, practised: an inscription with tabs, quotes and backslashes
  5. 5 Vessels of the Forge Variables and types: int, double, char, bool and std::string
  6. 6 The Familiar's Stall Card Variables, practised: describing a familiar and updating it
  7. 7 Measures of the Crucible Arithmetic: + - * / %, integer division, precedence, += and ++
  8. 8 The Alloy Reckoning Arithmetic, practised: an alloy worked out step by step
  9. 9 The Listening Anvil Reading input: std::cin >> and std::getline
  10. 10 Petitions at the Forge Gate Input, practised: getline for a whole line, then numbers
  11. 11 The Unchanging Seal const, static_cast and auto
  12. 12 The Cipher of Shifted Runes const, static_cast and auto, practised: char and int
  13. 13 The Scales of the Assayer Comparisons and bool
  14. 14 Two Names on the Ledger Comparisons and bool, practised: comparing strings
  15. 15 The Hours of the Archive if, else if and else
  16. 16 The Mandrake Bargain if, else if and else, practised
  17. 17 The Triple Lock &&, ||, ! and the ternary ?:
  18. 18 The Calendar Keeper's Rule &&, ||, ! and the ternary ?:, practised
  19. 19 The Reckoning Engine Capstone: input, conversion, comparison and choice together
  20. 20 The Chandler's Ledger Capstone practice: a complete small program
Part II · The Turning Wheel Beginner Lessons 21–40
  1. 21 The Patient Flame while loops: repeating while a condition holds
  2. 22 The Doubling Hoard while loops, practised: a counter and a goal
  3. 23 Counting the Prayer Beads for loops: counting up and down, sums and products
  4. 24 The Stepping Stones of the Ford for loops, practised: steps up and down
  5. 25 The Chant Cut Short do-while, break and continue
  6. 26 The Oracle Asks Again do-while, break and continue, practised: a guessing rite
  7. 27 The Lattice of Stars Nested loops: grids and patterns of characters
  8. 28 The Tablet of Products Nested loops, practised: tables and hollow frames
  9. 29 The Hall of Five Runes switch on ints and chars: case, break, default and fall-through
  10. 30 The Alchemist's Reckoner switch, practised: a calculator for many lines
  11. 31 Rites Given a Name Functions: parameters, return values and calling one function from another
  12. 32 The Apothecary's Measures Functions, practised: returning double and bool, and functions in conditions
  13. 33 The Borrowed Vessel void functions, pass by value and by reference (&), default arguments and overloading
  14. 34 Rites of Many Shapes References, default arguments and overloading, practised
  15. 35 The Rack of Vials std::vector: push_back, size, indexing and range-based for
  16. 36 The Tally of the Reliquary std::vector, practised: functions that take and return vectors
  17. 37 The Inscribed Ribbon std::string in depth: size, characters, substr, find, comparing and looping
  18. 38 The Cipher of the Scribe std::string, practised: functions that read and build strings
  19. 39 The Forge-Master's Ledger Capstone: functions, vectors, strings and loops working together
  20. 40 The Anvil's Last Ring Capstone practice: a complete reckoning with functions, vectors, strings and switch
Part III · Shapes of Iron Beginner Lessons 41–60
  1. 41 The Bound Coffer Structs: grouping several values into one new type
  2. 42 The Muster of Familiars Structs, practised: vectors of structs and functions that read them
  3. 43 The Sealed Reliquary Classes: private data and public member functions
  4. 44 The Warden of the Purse Classes, practised: a guarded object that keeps a running record
  5. 45 Words Spoken at the Making Constructors: default and parameterised constructors and member initialiser lists
  6. 46 The Hourglass Moulds Constructors, practised: several constructors, delegation and a guarded object
  7. 47 The Ward That Never Breaks const member functions, getters and setters that guard an invariant
  8. 48 The Granary Ledger const members and invariants, practised: a store with a capacity
  9. 49 Runes That Learn to Add Operator overloading: operator+, operator== and operator<< for your own types
  10. 50 The Coin of Two Metals Operator overloading, practised: arithmetic, comparison and printing for a money type
  11. 51 The Ledger of Paired Names std::map: keys and values, [] and find/count, iterating in key order
  12. 52 The Tally of the Whispered Words std::map in practice: counting words read from input
  13. 53 The Ordering of the Ingots std::sort with a custom comparison (a lambda), and std::set for unique sorted values
  14. 54 The Roll of Unrepeated Sigils std::set and std::sort in practice: unique names and an ordering by length
  15. 55 The Finger That Points Pointers: &, *, nullptr, pointers to structs with ->, pointers versus references
  16. 56 The Assayer's Pointing Rod Pointers in practice: walking an array with a pointer, returning a pointer or nullptr
  17. 57 The Furnace That Gives and Takes The heap: destructors and object lifetime, new and delete, std::unique_ptr and std::make_unique
  18. 58 The Brazier Row of the Night Vigil unique_ptr and destructors in practice: a vector of owned objects
  19. 59 The Smithy's Great Ledger Capstone: a class holding a map, sorting a report, and reading commands from input
  20. 60 The Guild Roll of the Bronze Season Capstone practice: structs, a class, maps, sets, sorting and owned objects together
Part IV · The Tempered Steel Intermediate Lessons 61–80
  1. 61 The Wandering Needle of the Assay Hall Iterators: begin/end, *it and ++it, std::find and std::find_if, insert and erase
  2. 62 The Roll Amended by Needle and Quill Iterators in practice: editing a roster with find, insert and erase
  3. 63 The Familiars That Carry Their Embers Lambdas in depth: captures, mutable, std::function, and the algorithms that take them
  4. 64 The Rites Handed From Hand to Hand Lambdas in practice: mutable state, lists of rules, reference captures
  5. 65 The Bound Pairs of the Assayer's Scale std::pair, std::tuple, structured bindings, returning several values; std::unordered_map
  6. 66 The Census of the Two-Moon Covens Tuples and unordered_map in practice: grouping records and ordering by several keys
  7. 67 The Smithy's Order of Waiting Work std::stack, std::queue, std::deque and std::priority_queue (with std::greater)
  8. 68 The Furnace Queue of Urgent Commissions priority_queue with a comparison struct, and a stack for undo
  9. 69 The Mould That Takes Any Metal Templates: function templates, deduction, several type parameters, class templates
  10. 70 The Twin Moulds of the Tally Guild Templates in practice: two type parameters, a class template over a map, templates taking callables
  11. 71 The Lineage of Blades Inheritance and polymorphism: base and derived classes, virtual and override, abstract bases, virtual destructors
  12. 72 The Duel of the Rune-Forged Polymorphism in practice: a factory returning std::unique_ptr<Base>, virtual functions with parameters, a base default overridden by some kinds
  13. 73 The Twice-Struck Seal Copying and moving: copy constructor and copy assignment, deep copies, move constructor and std::move, the rules of three, five and zero, RAII
  14. 74 The Hoard That Grows by Doubling The rule of five in practice: an owning container with a raw heap buffer, growth by doubling, deep copies, cheap moves, and a static count of live buffers
  15. 75 The Three Tempers of the Quench enum class (scoped enums), switch over an enum, and std::optional for answers that may be missing
  16. 76 The Quench Log of Uncertain Hands enum class and std::optional in practice: validating messy input by hand, counting by enum, optional results through a whole program
  17. 77 The Assayer's Columned Scroll String streams and formatting: std::istringstream, std::getline with a delimiter, std::ostringstream, and <iomanip> (setw, left/right, setfill, fixed, setprecision)
  18. 78 The Tithe-Roll of the Forge-Hall Parsing and formatting in practice: reading whole lines, splitting fields, validating each with a stream, and printing an aligned report with totals
  19. 79 The Forgemaster's Book of Commissions Part IV capstone: parsing lines with string streams into a polymorphic hierarchy, a factory, a priority queue for the work order, and a formatted report
  20. 80 The Reckoning of the Iron Season Part IV practice capstone: a command-driven ledger with enum class states, optional parsing, a map of records, a sorted and formatted report
Part V · The Guild's Engines Intermediate Lessons 81–100
  1. 81 The Engine That Turns Within Itself Recursion in depth: base cases, returning collections, memoising with a map, backtracking
  2. 82 The Lockwright's Engine of Arrangements Backtracking in practice: distinct arrangements of letters that obey a rule
  3. 83 The Survey of the Undercroft Galleries Grids: vectors of vectors, neighbours with direction arrays, flood fill and breadth-first search
  4. 84 The Warmth Map of the Many Forges Grids in practice: breadth-first search from many starts at once
  5. 85 The Guild's Sealed Chambers Organising code: namespaces, static members, static locals, constexpr functions
  6. 86 The Mint-Chamber of Numbered Coins Organising code in practice: nested namespaces, constexpr checks and class-wide counters
  7. 87 The Purse That Knows Its Own Worth Operators in depth: +=, + from +=, == and < for sorting and keys, [] and >> alongside <<
  8. 88 The Seven-Day Ledger of the Guild Halls Operators in practice: a value type with [], +=, +, ==, <, << and >> at work in a program
  9. 89 The Bursar's Ordered Vaults Ordered containers in depth: custom comparators, lower_bound/upper_bound/equal_range, multiset and multimap
  10. 90 The Hourglass Register of the Forge-Bays Ordered containers in practice: booking spans of time without overlaps
  11. 91 The Assayer's Second Rack of Tools The algorithm toolbox II: searching sorted ranges, unique, reverse, rotate, minmax_element, stable_partition, nth_element, iota and partial_sum
  12. 92 The Weighing-Room of the Ingot Guild The algorithm toolbox II, practised: answering queries over a shelf of weights
  13. 93 The Engine Built of Lesser Engines Designing with composition: has-a, std::function members as pluggable rules, small interfaces used through references
  14. 94 The Vault of the Pluggable Wardens Composition, practised: an object with an invariant, a pluggable admission policy and an auditor interface
  15. 95 The Sigil-Locks of the Engine Room Bits and flags: & | ^ ~ << >>, testing, setting, clearing and toggling bits, flags in an unsigned with an enum, std::bitset
  16. 96 The Lockwright's Sixteen Pins Bits and flags, practised: a sixteen-pin lock worked by commands
  17. 97 The Lantern Shared Among Keepers Shared ownership: std::shared_ptr, make_shared and use_count, std::weak_ptr and lock(), and breaking cycles
  18. 98 The Founders' Tree of Masters and Apprentices Shared ownership, practised: a tree whose masters own their apprentices and whose apprentices only remember their masters
  19. 99 The Waystation Charts of the Wandering Guild Part V capstone: a chart read from input, breadth-first routes on a grid, a custom-ordered set and a formatted report
  20. 100 The Grand Muster of the Engine Guild Part V capstone, practised: hiring by skill flags, scheduling jobs by day ranges, and a formatted roster
Part VI · The Deep Foundry Advanced Lessons 101–120
  1. 101 The Crucible That Knows the Lent From the Given Value categories: lvalues and rvalues, rvalue references, std::move and std::forward, perfect forwarding, emplace_back and noexcept moves
  2. 102 The Ledger of Molten Charges Value categories, practised: counting copies and moves, forwarding into a container, emplacing, and moving out
  3. 103 The Mould of Uncounted Cavities Variadic templates: parameter packs, sizeof..., recursion over a pack, fold expressions, forwarding a pack, std::tuple with std::apply
  4. 104 The Herald of the Many-Throated Furnace Variadic templates, practised: a placeholder formatter, a typed maximum, forwarding a call, and composing functions with a fold
  5. 105 The Foundry That Casts Before the Fire Compile-time programming: if constexpr, <type_traits>, static_assert, full and partial template specialisation, constexpr tables
  6. 106 The Assayer's Sealed Tables of Proof Compile-time programming, practised: constexpr tables sized by a template parameter, constrained templates, and a family of specialisations that print any nested value
  7. 107 The Slug That Takes Three Shapes Sum types: std::variant, index/holds_alternative/get_if, std::visit with an overloaded set of lambdas, std::monostate, and variants versus inheritance
  8. 108 The Reckoning-Engine of Poured Symbols Variants, practised: an expression tree of variant nodes held in a vector, built from reverse Polish notation, evaluated, rendered and simplified by visiting
  9. 109 The Needle Cut for a Strange Coffer Writing your own iterators: a nested iterator class with the five iterator aliases, *, prefix and postfix ++, == and !=, begin/end and const versions, and an iterator that makes its values lazily
  10. 110 The Coffer of Nested Drawers Your own iterators, practised: a class template whose single iterator template (const and non-const) walks nested drawers in order, skipping empty ones
  11. 111 The Crucible That Pours Into Any Mould Generic algorithms of your own: templates over iterator pairs, predicates, stateful function objects, templates vs std::function
  12. 112 The Assayer's Sieve of Many Vessels Generic algorithms, practised: stable partitioning, folds, max by a key, stateful predicates and erasing from any container
  13. 113 The Tunnels Beneath the Deep Foundry Graphs: adjacency lists, depth-first search, topological order with Kahn's algorithm, Dijkstra's shortest paths and the road back
  14. 114 The Ore-Carts of the Sunken Galleries Graphs, practised: named nodes, cheapest routes with the road taken, reachability, and an order for dependent work
  15. 115 The Ledger That Remembers Every Melt Dynamic programming: from memoised recursion to bottom-up tables, coin problems, the longest common subsequence with its reconstruction, and edit distance
  16. 116 The Smelter's Hoard of Scarce Ore Dynamic programming, practised: a bounded knapsack with a two-dimensional table and a reconstruction rule
  17. 117 The Assay of Weight and Waste Performance and memory: sizeof, alignment and padding, vector growth and reserve, avoiding copies with const& and std::string_view, counting work
  18. 118 The Bellows That Waste No Breath Performance, practised: a slot pool with a free list and counted growth, splitting through string views, and borrowing instead of copying
  19. 119 The Foundry's Book of Workings Part VI capstone: commands parsed into a std::variant, visited with overloaded lambdas, recursive needs and a topological casting order
  20. 120 The Last Pour of the Deep Foundry Part VI capstone, practised: a command language over std::variant, a schedule from a topological order and a longest-path table, and the critical chain
Part VII · The Master's Anvil Advanced Lessons 121–140
  1. 121 The Tongs That Hold a Single Coal Owning resources by hand: a move-only owner like std::unique_ptr, a reference count like std::shared_ptr, custom deleters and scope guards
  2. 122 The Brazier Kept by Many Hands Shared ownership by hand: a reference-counted handle with a control block, copy and move, self-assignment, and a custom deleter
  3. 123 The Hollow Rack That Widens Itself A container of your own: raw storage with ::operator new, placement new and explicit destructor calls, growth by doubling that moves, and emplace_back
  4. 124 The Armoury That Counts Its Blades A container of your own, practised: copying and copy-and-swap, move assignment, reserve, erase by shifting, shrink_to_fit and equality, with every copy and move counted
  5. 125 The Sigil-Bins of the Hashing Vault Hashing: buckets and load factor, specialising std::hash for your own key, combining hashes, and a separately chained hash table of your own
  6. 126 The Probing Keys of the Crowded Vault Hashing, practised: open addressing with linear probing, tombstones, rehashing on load, and counting probes
  7. 127 The Branching Ledger of the Elder Smiths Trees: a binary search tree owned through std::unique_ptr children (insert, find, in-order walk, height, erase with the in-order successor), and a first look at tries
  8. 128 The Lexicon Tree of the Word-Smiths Trees, practised: a trie with std::map of std::unique_ptr children, prefix counts kept in the nodes, alphabetical listing, the longest common prefix, and erasing with pruning
  9. 129 The Kinship Rolls of the Scattered Forges Range and set structures: union-find with path compression and union by size, and a Fenwick tree for prefix sums with point updates
  10. 130 The Watchtowers Over the Ore Road Range structures, practised: a segment tree for range minimum, maximum and sum with point updates, and a descent to the first value at least x
  11. 131 The Heralds of the Brass Bell Design patterns in modern C++: observers held by std::function and std::weak_ptr, commands with undo and redo, strategies by template or by std::function
  12. 132 The Furnace-Door of Seven Turnings Design patterns, practised: a state machine with enum class states and transitions, and a command history with undo and redo
  13. 133 The Mould That Knows Its Own Casting Static polymorphism and generic design: CRTP mixins, policy classes, tag dispatch, and detecting members with std::void_t
  14. 134 The Furnace Built to Its Master's Order Static polymorphism, practised: a policy-based class with the empty base optimisation, tag dispatch on iterator categories, and a detection trait
  15. 135 The Weighmaster's Halving Search Algorithm design: binary search on the answer, greedy choices justified by an exchange argument, and dynamic programming over bitmasks
  16. 136 The Cartographer's Tour of the Thirteen Forges Algorithm design, practised: binary search on the answer, greedy sweeps over sorted intervals with a min-heap, and the shortest tour by bitmask dynamic programming
  17. 137 The Brass Automaton of the Anvil Hall A virtual machine: stack-based bytecode, the fetch-and-execute loop with an instruction pointer, jumps, a step limit, and errors reported as values
  18. 138 The Tongue That Speaks to the Automaton A virtual machine, practised: compiling a small language with variables and while loops into stack bytecode, by recursive descent and backpatched jumps
  19. 139 The Tree of Spoken Workings Final capstone: an interpreter for a small language of recursive workings: a parsed tree of std::variant nodes owned by std::unique_ptr, visited to print and to evaluate, with call frames, short-circuit choices and a recursion limit
  20. 140 The Living Ledger of the Master's Anvil Final capstone, practised: a live spreadsheet: formulas parsed by recursive descent into trees, cells as a dependency graph, remembered values, cycle detection, errors carried as values, and a formatted table
Rust · 20 lessons of 140 planned · Beginner to advanced

Rust Basics

Rust from beginner to advanced, planned at one hundred and forty lessons. Rust is the oath-bound tongue: every value has one owner, every borrowing is sworn, and a stern warden of a compiler checks each oath before a spell may run. Part I is the oath of ownership: your first program, variables and mutability, the number types and casting, String and &str, if and the loops, functions, ownership, moves and borrowing, slices, structs and methods, enums and match, Option and Result, vectors, maps, iterators and closures, traits, and a whole program read line by line. Rust compiles ahead of time and no Rust compiler runs in a browser, so these lessons are taught with questions: Xher shows you real Rust, and you say what it prints, which line the warden refuses, and why.

Reader & Downloader members
Course outline 20 lessons in 1 part
Part I · The Oath of Ownership Beginner Lessons 1–20
  1. 1 Hail, Ferris! Your first Rust program: main and println!
  2. 2 Names Bound and Unbound Variables: let, mut and shadowing
  3. 3 The Measures of Number Integer, float, bool and char types
  4. 4 Reckoning and Casting Arithmetic and converting with as
  5. 5 Threads of Text String and &str
  6. 6 Forks in the Path if as an expression
  7. 7 The Wheel That Turns loop, while and for
  8. 8 Rites with Names Functions, parameters and return values
  9. 9 The Law of Ownership Moves, clones and Copy
  10. 10 Borrowed, Not Taken References and borrowing
  11. 11 A Slice of the Scroll String slices and array slices
  12. 12 The Forged Struct Structs, impl blocks and methods
  13. 13 Every Path Matched Enums and match
  14. 14 Something or Nothing Option
  15. 15 Success or Failure Result and the ? operator
  16. 16 The Growing Shelf Vectors
  17. 17 The Ledger of Keys HashMap and BTreeMap
  18. 18 Streams and Closures Iterators and closures
  19. 19 Oaths of Behaviour Traits
  20. 20 The Oath Fulfilled Capstone: reading a whole program
Go · 20 lessons of 140 planned · Beginner to advanced

Go Basics

Go from beginner to advanced, planned at one hundred and forty lessons. Go is the swift tongue of the gophers' burrows: small, plain and fast, made for programs where many hands work at once. Part I is the first burrow: your first program, variables and zero values, types and conversion, strings, bytes and runes, if and switch, the one loop, functions with many results and closures, arrays, slices and maps, structs, pointers and methods, interfaces, errors as values, defer, panic and recover, goroutines, channels and select, and a whole program read line by line. Go compiles ahead of time and no complete Go compiler runs in a browser, so these lessons are taught with questions: Xher shows you real Go, and you say what it prints and why.

Reader & Downloader members
Course outline 20 lessons in 1 part
Part I · The First Burrow Beginner Lessons 1–20
  1. 1 Hello from the Burrow Your first Go program: package main and fmt
  2. 2 Names in the Burrow Variables, zero values and constants
  3. 3 Kinds of Value Basic types and explicit conversion
  4. 4 The Counting-House Arithmetic and strconv
  5. 5 Bytes and Runes Strings in Go
  6. 6 The Branching Tunnels if and switch
  7. 7 The Only Loop for in all its forms
  8. 8 Many Returns Functions, multiple results and closures
  9. 9 Arrays and Slices Fixed arrays, growing slices and shared memory
  10. 10 The Map of the Warren Maps
  11. 11 Gathered Fields Structs
  12. 12 Pointing the Way Pointers
  13. 13 Methods on the Burrow Methods and receivers
  14. 14 Shapes That Fit Interfaces
  15. 15 Errors as Values The error interface
  16. 16 Deferred Rites defer, panic and recover
  17. 17 Many Hands Goroutines and sync.WaitGroup
  18. 18 Messages Down the Tunnel Channels
  19. 19 Waiting on Many select and sync.Mutex
  20. 20 The Warren Complete Capstone: reading a whole program
Python · 140 lessons · Advanced

Python Advanced

One hundred and forty lessons that carry you past Python Basics, from the easiest advanced arts to the hardest. Part I treats functions as familiars to be passed, combined and folded; Part II draws from the lazy well of iterators, generators and itertools and teaches the enchanter's craft of closures, decorators and context managers; Part III shapes familiars of your own with classes, protocols, abstract bases and dataclasses; Part IV builds the architecture of the archive, from stacks and linked lists to hash tables, trees, heaps and graphs; and Part V works the grand algorithms: sorting, searching, backtracking, dynamic programming, greedy choices and shortest paths. Every lesson is followed by a practice lesson on the same tool. Xher teaches each one, and the code is real Python that runs right here in your browser.

Reader & Downloader members
Course outline 140 lessons in 5 parts
Part I · Functions as Familiars Lessons 1–40
  1. 1 The Living Ritual Functions are values
  2. 2 The Rite Board Dispatch tables, practised
  3. 3 The Roll of Summonings Callables and registries
  4. 4 Rolls Within Rolls Registries, practised: private rolls made by a factory
  5. 5 Rituals That Forge Rituals Higher-order functions and composition
  6. 6 The Order of the Procession Higher-order functions and keys, practised
  7. 7 The Combinator's Bench Function factories and combinators
  8. 8 The Alembic Recipe Factories and combinators, practised: rituals built from a recipe
  9. 9 The Instrument Case The operator module
  10. 10 Tools From the Case The operator module, practised
  11. 11 The Herald's Precedence Sorting by many keys, in mixed directions
  12. 12 The Muster of Many Orders Sorting by many keys, practised: an order given as data
  13. 13 The Unhurried Stream Lazy map, filter and zip
  14. 14 The Long Procession of Readings Lazy pipelines, practised
  15. 15 The Unbraiding zip(*rows), strict zip, enumerate(start=), filter(None) and many-armed map
  16. 16 The Tally of the Twelve Wells zip, enumerate and map, practised: tables of readings
  17. 17 The Folded Incantation Comprehension mastery
  18. 18 The Weaver's Grid Comprehension mastery, practised
  19. 19 The Unbound Bundles Reshaping nested data, and when a loop is clearer
  20. 20 The Reliquary Inventory Reshaping nested data, practised: a vault of shrines
  21. 21 The Untouched Offering Pure functions and immutability
  22. 22 Ledgers That Never Change Pure functions and immutability, practised
  23. 23 The Sealed Register Immutable records: namedtuple and changed copies
  24. 24 The Warden's Unbroken Rolls Immutable records and nested updates, practised
  25. 25 The Folding of the Many functools.reduce
  26. 26 The Alchemist's Fold functools.reduce, practised
  27. 27 The Fold Unfolded Folds in practice: operator functions, folds by hand, and the built-ins
  28. 28 The Tallykeeper's Choice Choosing the right fold, practised
  29. 29 The Bound Ingredient functools.partial
  30. 30 The Prepared Reagents functools.partial, practised
  31. 31 The Bound and the Borrowed partial, lambda or closure, and currying by hand
  32. 32 The Spell Taken Word by Word Currying and partial application, practised
  33. 33 The Nested Reliquary Structural recursion over nested lists
  34. 34 The Spirit Genealogy Structural recursion over nested dictionaries, practised
  35. 35 The Grafter's Recursion Recursion that builds new structures: deep merge, pruning and accumulators
  36. 36 The Hedgerow Rewritten Building new nested structures, practised
  37. 37 The Purifying Procession Capstone: a pipeline of pure functions
  38. 38 The Conclave's Reckoning Capstone: a pipeline of pure functions, practised
  39. 39 The Almanac of Workings Capstone: records, composition, folds and partials together
  40. 40 The Grand Herbarium Capstone practice: a functional reckoning over nested records
Part II · The Lazy Well and the Enchanter's Craft Lessons 41–80
  1. 41 The Turning Key The iterator protocol: iter(), next() and StopIteration
  2. 42 The Rosary of Beads Iterator classes and reusable iterables, practised
  3. 43 The Sentinel's Watch iter(callable, sentinel), one-shot iterators and looking ahead
  4. 44 The Scout Who Looks Ahead Looking ahead in an iterator with peek and push_back, practised
  5. 45 The Well That Remembers Generators in depth: state, endless streams, return and yield from
  6. 46 The Echoing Vault Generators in depth, practised
  7. 47 The Answering Well Two-way generators: send(), priming, close() and GeneratorExit
  8. 48 The Ledger-Spirit Coroutines that keep state and tidy up on close(), practised
  9. 49 The Slow Procession Lazy generator pipelines
  10. 50 The River of Tallies Lazy pipelines, practised
  11. 51 The Moving Lens Sliding windows, fixed-size chunks and neighbour pairs over streams
  12. 52 The Lantern Bearers' Shifts Chunks and neighbour pairs over streams, practised
  13. 53 The Wheel of Endless Turning itertools: count, cycle, repeat, islice, chain and zip_longest
  14. 54 The Bell-Ringer's Rota itertools, practised
  15. 55 The Loom of Many Threads More itertools: starmap, compress, filterfalse, tee, pairwise and batched
  16. 56 The Twin Scribes' Tally tee, batched and pairwise over single-pass streams, practised
  17. 57 Sorting the Relics itertools: groupby, accumulate, takewhile, dropwhile, product, permutations, combinations
  18. 58 The Alchemist's Permutations itertools, practised
  19. 59 The Alchemist's Encodings product(repeat=), combinations_with_replacement, run-length groupby and accumulate with a function and initial=
  20. 60 The Dice of the Oracle Counting with product, combinations_with_replacement and groupby, practised
  21. 61 The Keeper of Embers Closures in depth: nonlocal and the late-binding trap
  22. 62 The Purse With Three Clasps Closures sharing private state
  23. 63 The Cabinet of Many Doors Closures as lightweight objects: several functions over one hidden state
  24. 64 The Ferryman's Waiting Line Closures as objects, practised: bundling the doors in a namedtuple
  25. 65 The Enchanter's Seal functools.wraps and decorators that take arguments
  26. 66 Thrice-Tried Incantations Decorator factories in practice
  27. 67 The Seal That Bends to Either Hand Decorators that work with or without arguments
  28. 68 Marks Made Bare or Bidden Flexible decorators, practised: a positional setting and a keyword one
  29. 69 Seals Upon Seals Stacking decorators and decorators that keep state
  30. 70 The Scribe Who Writes Once Stateful decorators in practice
  31. 71 Wards at the Threshold Validating decorators: refusing bad arguments and bad results
  32. 72 The Gatekeeper's Book of Rules Validating decorators in practice: rules as predicates
  33. 73 Drawing the Circle Context managers: with, __enter__/__exit__ and contextlib
  34. 74 The Borrowed Tome Context managers in practice
  35. 75 The Stack of Many Candles contextlib in depth: ExitStack and nullcontext
  36. 76 The Circle That Transmutes Misfortune Generator context managers that catch, translate and clean up
  37. 77 The Lantern Procession Capstone: generators, itertools, closures, decorators and context managers together
  38. 78 The Night Watch Engine Capstone practice: a complete lazy, enchanted engine
  39. 79 The Conclave of Lamps Capstone: closure objects, flexible decorators, ExitStack and lazy streams together
  40. 80 The Last Watch Before the Turning Capstone practice: an engine of closures, flexible wards, lazy omens and an ExitStack
Part III · The Shaping of Familiars Lessons 81–100
  1. 81 The Common Hearth Class attributes, @classmethod and @staticmethod
  2. 82 The Roll of Spirits Class attributes and class methods, practised: numbering, records and batches
  3. 83 The Brazier's Measures Properties in depth: validating setters, two-way computed attributes, read-only values, repr and str
  4. 84 The Apothecary's Elixirs Properties in depth, practised: measures, doses and a repr that rebuilds
  5. 85 The Arithmetic of Charms Operator overloading: __add__, __radd__, __mul__, __eq__ with __hash__, and total_ordering
  6. 86 The Ley Line Reckoner Operator overloading, practised: a vector of power
  7. 87 The Litany That Behaves Container protocols: __len__, __getitem__ with slices, __contains__, __iter__ and truth
  8. 88 The Calendar of Rites Container protocols, practised: a mapping with __setitem__ and __delitem__
  9. 89 Lineages Intertwined Inheritance in depth: super() chains, cooperative multiple inheritance, mixins and method resolution order
  10. 90 The Order of the Rite Cooperative inheritance, practised: a diamond of rites that runs each step once
  11. 91 The Familiar Within the Familiar Composition and delegation over inheritance
  12. 92 The Roll and the Coven Composition and delegation, practised: a collection that keeps its own rules
  13. 93 The Covenant Unwritten Abstract base classes: abc.ABC and @abstractmethod
  14. 94 The Litany and the Codex collections.abc, practised: Sequence and Mapping give methods for free
  15. 95 The Scribe's Mould dataclasses: fields, defaults, default_factory, order, frozen and __post_init__
  16. 96 The Ledger of Weighed Omens dataclasses, practised: compare=False, repr=False, init=False and asdict
  17. 97 The True Names of the Moon Enums and duck typing: enum.Enum, members, and typing.Protocol
  18. 98 Wards Woven Together Enums, practised: Flag members combined with | and tested with in
  19. 99 The Grimoire That Binds Itself Capstone: enums, frozen dataclasses, composition and container protocols together
  20. 100 The Coven's Account Book Capstone practice: abstract strategies, dataclasses, enums and a delegating container
Part IV · The Architecture of the Archive Lessons 101–120
  1. 101 The Price of Every Rite Counting the cost: Big-O by counting steps
  2. 102 The Ledger of Costs Counting the cost, practised: replacing nested loops with sets and dicts
  3. 103 The Tower of Stacked Plates Stacks: last in, first out
  4. 104 The Reckoning Read Backwards Stacks, practised: postfix reckoning and undo with redo
  5. 105 The Patient Queue at the Gate Queues and deques: first in, first out
  6. 106 The Circle of the Bell Rope Deques, practised: rotation, bounded buffers and fair interleaving
  7. 107 The Chain of Linked Sigils Linked lists: nodes that point to the next
  8. 108 The Chain Turned Back on Itself Linked lists, practised: reversing in place, inserting and the fast-and-slow walk
  9. 109 The Vault of Many Buckets Hash tables from scratch: buckets, collisions and resizing
  10. 110 The Unhashable Offering Hashing, practised: freezing values into keys and a set built from buckets
  11. 111 The Tree of Ordered Branches Binary search trees: insert, search, smallest and largest, in-order traversal
  12. 112 The Catalogue of Nearest Hours Binary search trees, practised: a tree class with floor, ceiling and ranges
  13. 113 Walking the Spirit Lineage Tree traversals: pre-order, post-order, level-order with a deque, height and leaves
  14. 114 The Measure of the Lineage Tree traversals, practised: balance, widest generation, paths and mirrored copies
  15. 115 The Queue of Precedence Heaps and priority queues: heapq, tie-breaking counters, top-k and merging sorted streams
  16. 116 The Three Brightest Omens Heaps, practised: merging streams by hand, the k most frequent, and a running k-th largest
  17. 117 The Web of Hidden Roads Graphs: adjacency sets, depth-first search with recursion and a stack, components and cycles
  18. 118 The Rivers That Run One Way Graphs, practised: directed roads, hop counts, loops found by colouring, and counting paths
  19. 119 The Lending Desk of the Archive Capstone: choosing and combining dictionaries, deques and heaps in one keeper
  20. 120 The Courier Guild of the Hidden Roads Capstone practice: a graph, a priority queue and breadth-first routes working together
Part V · The Grand Algorithms Lessons 121–140
  1. 121 The Settling of the Stones Sorting by hand: selection, insertion and merge sort
  2. 122 The Count of Stones Out of Place Merge sort, practised: sorting by a key and counting inversions
  3. 123 The Pivot Stone Quicksort and partitioning in place
  4. 124 The Three Heaps of the Augur Partitioning, practised: three-way partition, quickselect and stability
  5. 125 The Seeker at the Boundary Binary search in depth: lower and upper bounds, and bisect
  6. 126 The Narrowing of the Cart Binary search, practised: searching on the answer
  7. 127 The Two Torches Two pointers and sliding windows
  8. 128 The Watchman's Sliding Pane Sliding windows, practised: fixed, distinct and shortest windows
  9. 129 The Maze of Choices Backtracking: subsets, orderings and pruning
  10. 130 The Queens of the Night Court Backtracking, practised: placing queens and tracing words
  11. 131 The Table of Remembered Steps Dynamic programming: from memoised recursion to bottom-up tables
  12. 132 The Thorned Garden Dynamic programming in a grid, practised: counting, minimising and retracing
  13. 133 The Scribes' Reconciliation Dynamic programming over two sequences: common subsequences and edit distance
  14. 134 The Pilgrim's Satchel Knapsack problems, practised: once-only and reusable items, and recovering the choice
  15. 135 The Greedy Hand Greedy algorithms: when the best step now is the best overall, and when it is not
  16. 136 The Lamplighters of the Long Road Greedy algorithms, practised: covering, sweeping and jumping
  17. 137 The Cartographer's Lantern Shortest paths with Dijkstra's algorithm, and topological order
  18. 138 The Toll Roads of the Marches Shortest paths and topological order, practised
  19. 139 The Atlas of Every Road Capstone: choosing structures and algorithms together inside a class
  20. 140 The Last Lamp of the Archive Final capstone practice: heaps, tables, sorting and greedy scheduling in one scriptorium
Python · 40 lessons of 80 planned · Track

Ciphers & Codes

Secret writing from the scribes of Rome to the codebreakers of the twentieth century, worked in Python: the Caesar shift and the Atbash mirror, Polybius squares and the Vigenère table, frequency counting and breaking ciphers by hand and by program, the Playfair square, Kasiski and Friedman's attacks on Vigenère, the one-time pad, the rotors of the Enigma, and the public keys, hashes and signatures that guard messages today.

Reader & Downloader members
Course outline 40 lessons in 3 parts
Part I · The Hidden Hand Beginner Lessons 1–12
  1. 1 What the Scribes Concealed Substitution ciphers with a dictionary
  2. 2 Caesar's Three Steps ord(), chr() and the shift cipher
  3. 3 Twenty-Six Keys at the Lock Decoding and brute force
  4. 4 The Hebrew Looking-Glass Atbash: reversing the alphabet
  5. 5 Thirteen Steps and a Table ROT13 with str.maketrans() and translate()
  6. 6 The Square of Polybius Letters as coordinates in a grid
  7. 7 The Voices of the Letters Counting letter frequencies with a dictionary
  8. 8 Where the E Hides Breaking a Caesar cipher by frequency
  9. 9 The Table of Vigenère A keyword cipher: shifts that change letter by letter
  10. 10 Undoing the Indecipherable Decoding Vigenère with the key
  11. 11 The Fence of Rails A transposition cipher: moving letters instead of changing them
  12. 12 The Thrice-Sealed Letter Combining ciphers: undoing layers in reverse
Part II · The Black Chambers Intermediate Lessons 13–24
  1. 13 Reading Down the Fence Undoing a transposition by rebuilding its pattern
  2. 14 The Keyword Alphabet Mixed alphabets with zip() and a dictionary
  3. 15 The Spy's Columns Columnar transposition: slicing with a step and sorting with a key
  4. 16 The Affine Seal Multiplying letters modulo 26, and the modular inverse
  5. 17 Wheatstone's Square Building a 5 x 5 grid and splitting text into pairs
  6. 18 The Playfair Rules Finding a letter in a grid and following three rules
  7. 19 Friedman's Coincidences Measuring a text with the index of coincidence
  8. 20 Kasiski's Repetitions Finding a repeating key's length from the gaps between repeats
  9. 21 Breaking the Indecipherable Solving each column of a Vigenère cipher with the chi-squared score
  10. 22 The Pad Used Once Bytes, encode() and decode(), and the ^ (exclusive or) operator
  11. 23 The Wheels of the Enigma Rotors: scrambled wiring that turns with every letter
  12. 24 The Enigma Speaks Capstone: plugboard, rotors and reflector in one machine
Part III · The Modern Keys Advanced Lessons 25–40
  1. 25 Bacon's Two Letters Text as bits: encode(), format() and int(s, 2)
  2. 26 The Sixty-Four Signs Base64 by hand: int.from_bytes and the shift operator >>
  3. 27 The Shift Register's Song A linear-feedback shift register
  4. 28 A Stream from the Register A stream cipher: bits into bytes, then xor
  5. 29 The Fingerprint of a Message Hash functions with hashlib
  6. 30 The Keyed Seal HMAC: proving who sent a message
  7. 31 Squaring and Multiplying Fast powers modulo a number
  8. 32 Euclid's Old Engine The greatest common divisor and the extended Euclidean algorithm
  9. 33 A Secret Agreed in Public The Diffie-Hellman key exchange
  10. 34 Witnesses for the Primes The Miller-Rabin test
  11. 35 Rivest, Shamir and Adleman RSA keys: a lock anyone may close
  12. 36 Words into Numbers int.from_bytes and to_bytes: sealing text with RSA
  13. 37 The Signature That Cannot Be Forged Digital signatures: sealing with the private key
  14. 38 Breaking a Small Key Factoring: trial division and Fermat's method
  15. 39 The Secret Divided Among Many Shamir's secret sharing: polynomials and interpolation
  16. 40 The Letter Sealed and Tagged Capstone: agreeing a key, sealing and authenticating a letter
Python · 40 lessons of 80 planned · Track

Celestial Reckoning

The arithmetic the old astronomers and astrologers did by candlelight, worked in Python: degrees and the zodiac, calendars and the day of the week, the phases of the Moon, planetary hours, sidereal time, the Ascendant and the houses, Kepler's laws and the places of the planets, eclipses and parallax, and an ephemeris reckoned on Kepler's ellipses.

Reader & Downloader members
Course outline 40 lessons in 3 parts
Part I · The Turning Sky Beginner Lessons 1–12
  1. 1 Degrees, Minutes and Seconds Sexagesimal angles
  2. 2 Unwinding the Degree // and % with sixties
  3. 3 The Belt of Twelve Signs Longitude to sign
  4. 4 Arcs Upon the Circle Angles modulo 360
  5. 5 The Five Aspects Matching within an orb
  6. 6 Two Calendars, Two Leap Years Boolean rules
  7. 7 Zeller's Weekday Reckoning A formula in integer arithmetic
  8. 8 The Count of Julian Days Counting days from one epoch
  9. 9 The Age of the Moon Cycles with %
  10. 10 The Chaldean Order of the Hours Cycling through a list
  11. 11 The Golden Number Cycles and comparison
  12. 12 The Reckoning of Easter A long computation, step by step
Part II · The Wandering Stars Intermediate Lessons 13–24
  1. 13 The Well at Syene The math module, and a measurement from shadows
  2. 14 Counting in Sixties Place value in base 60, with int() to cut off fractions
  3. 15 The Ten Lost Days Converting between calendars through the Julian Day count
  4. 16 The Length of the Day Trigonometry with math.tan, math.acos and radians
  5. 17 The Sun's Yearly Road A low-precision formula for the Sun's longitude
  6. 18 From Ecliptic to Equator Changing coordinates with math.atan2 and math.asin
  7. 19 The Clock of the Stars Sidereal time from the Julian Day
  8. 20 The Rising Sign The Ascendant and Midheaven from sidereal time
  9. 21 The Twelve Houses Dividing the circle from a starting point
  10. 22 Kepler's Harmony of the Worlds Powers and fractional exponents with **
  11. 23 Kepler's Equation Solving an equation by repeated refinement
  12. 24 The Wanderers in Their Courses Capstone: where the planets stand, seen from the Earth
Part III · The Clockwork of the Heavens Advanced Lessons 25–40
  1. 25 The Distance of the Moon Parallax: distance from a small angle
  2. 26 Aristarchus and the Half Moon A ratio from a right triangle
  3. 27 The Saros of the Chaldeans Cycles that bring eclipses back
  4. 28 The Dragon's Head and Tail Angular distance on a circle
  5. 29 Sunrise and Sunset Hour angles, and returning None
  6. 30 The Equation of Time Why the sundial and the clock disagree
  7. 31 The Astrolabe's Question Altitude and azimuth from the hour angle
  8. 32 The Shadow of the Gnomon Noon altitude and shadow length
  9. 33 The Faces of the Moon Illumination from elongation, and naming ranges
  10. 34 Ptolemy's Wheels Within Wheels Adding circular motions: the epicycle
  11. 35 The Great Conjunctions Repeating steps around a circle
  12. 36 The Precession of the Equinoxes A slow drift, and the two zodiacs
  13. 37 The Speed of a Planet Kepler's second law and the vis-viva equation
  14. 38 Weighing the Wanderers Newton's form of Kepler's third law
  15. 39 The True Ellipse A planet's position on its Keplerian orbit
  16. 40 The Ephemeris Capstone: a table of planetary places
JavaScript · 40 lessons of 80 planned · Track

Patterns: The Art of Regular Expressions

Regular expressions, the compact spells for finding and reshaping text, learned in JavaScript on the archive's own kind of material: catalogue entries, dates in old documents, Latin and Greek names, page references and marginal marks, then reshaping whole transcriptions: echoes, abbreviations, shelfmarks, tokens and dates, and at last the scholar's tools: concordances, parsers, highlighting and indexes.

Reader & Downloader members
Course outline 40 lessons in 3 parts
Part I · The First Patterns Beginner Lessons 1–12
  1. 1 The First Sigil Literal patterns and test()
  2. 2 The Scribe's Alphabet Character classes, ranges and negation
  3. 3 Counting the Repetitions Quantifiers + * ? {n,m} and match()
  4. 4 Bounded by the Margins Anchors ^ and $, and word boundaries \b
  5. 5 The Parting of the Ways Alternation | and grouping ( )
  6. 6 Captured in the Circle Capturing groups with match() and exec()
  7. 7 Every Instance in the Book The g flag, match() and matchAll()
  8. 8 The Copyist's Exchange replace() with patterns and $1 back-references
  9. 9 Names Spoken Aloud Named groups (?<name>...)
  10. 10 Neither Case Nor Line The i and m flags
  11. 11 The Careful Glance Ahead Lookahead (?=) and lookbehind (?<=)
  12. 12 The Cataloguer's Engine Putting the patterns together
Part II · The Reshaping Arts Intermediate Lessons 13–24
  1. 13 The Patient Quantifier Lazy quantifiers: *? and +?
  2. 14 Echoes in the Text Backreferences: \1 and $1
  3. 15 The Numerals of Rome Non-capturing groups (?:...) and validating with a pattern
  4. 16 Cutting at the Seams split() with a pattern
  5. 17 The Transforming Replace replace() with a function
  6. 18 Patterns Forged at Runtime new RegExp() and escaping special characters
  7. 19 The Dot That Crosses Lines The s (dotAll) flag
  8. 20 Letters of Every Alphabet The u flag and Unicode property escapes \p{...}
  9. 21 A Dated Document Named groups in replacement functions
  10. 22 Reading Step by Step The y (sticky) flag and lastIndex: a tokenizer
  11. 23 The Shelfmarks of the Library Composing a pattern once and using it twice
  12. 24 The Transcriber's Engine Capstone: a chain of replacements in a careful order
Part III · The Grammar of Patterns Advanced Lessons 25–40
  1. 25 Letters Without Their Marks normalize() and \p{M}
  2. 26 Counting the Words Word frequencies with a Map
  3. 27 The Concordance match.index and context around a match
  4. 28 Knowing Where: the d Flag match.indices and the positions of groups
  5. 29 Names in the Replacement $<name> in replacement strings
  6. 30 The Guarded Gate Several lookaheads at one place
  7. 31 The Template Engine Filling placeholders with a replacement function
  8. 32 Pounds, Drams and Grains Optional parts and fractions in a parser
  9. 33 The Scribe's Emphasis Ordering replacements in a small markup language
  10. 34 Where Sentences End Splitting with lookbehind and lookahead together
  11. 35 Fields Between Commas A sticky pattern for quoted fields
  12. 36 Lighting the Search Building one alternation from many terms
  13. 37 From Numerals to Numbers Tokens with alternation, then arithmetic
  14. 38 Line and Column Turning a position into a line and column
  15. 39 A Table of Rules Data-driven replacement: rules as [pattern, replacement] pairs
  16. 40 The Index Maker Capstone: a back-of-book index
Latin · 70 lessons of 120 planned · Track

Latin of the Grimoires

Enough Latin to find your way through a grimoire or an alchemical treatise: the alphabet and its abbreviations, nouns and their cases, the verbs of making and calling, and the stock phrases of title pages, planetary tables and the Emerald Tablet, the opening of Agrippa's Occult Philosophy and the whole of the Emerald Tablet; then the finer grammar, Virgil's underworld and the Sator square, and readings from the Dies Irae and O Fortuna to Pico, Dee, Maier's emblems, Aquinas and Llull. No code: questions and translations, judged by Xher.

Reader & Downloader members
Course outline 70 lessons in 5 parts
Part I · Prima Materia Beginner Lessons 1–12
  1. 1 The Letters of the Old Hand The alphabet, u and v, i and j, ligatures
  2. 2 Marks of the Scribe's Pen Scribal abbreviations
  3. 3 Daughters of the First Declension First-declension nouns
  4. 4 Magi and Signs: the Second Declension Second-declension nouns, masculine and neuter
  5. 5 Six Roles of the Noun The cases
  6. 6 The Great Work Agrees Adjectives and agreement
  7. 7 I Am the Light: the Verb Sum The verb sum, esse
  8. 8 Pray and Work: the First Conjugation First-conjugation verbs in the present
  9. 9 Commands of the Circle Imperatives and invocations
  10. 10 Into, Out Of, Concerning Prepositions
  11. 11 Sol, Luna and the Seven Metals Planets, elements and metals
  12. 12 Reading the Emerald Tablet Capstone: a passage of the Latin Tabula Smaragdina
Part II · Nigredo Intermediate Lessons 13–24
  1. 13 Light and Stone: the Third Declension Third-declension nouns and their stems
  2. 14 Spirit and Thing: the Fourth and Fifth Declensions Fourth- and fifth-declension nouns
  3. 15 To See and To Have: the Second Conjugation Second-conjugation verbs in the present
  4. 16 Write, Read and Hear: the Third and Fourth Conjugations Third- and fourth-conjugation verbs
  5. 17 Veni, Vidi: the Perfect Tense The perfect tense: what was done
  6. 18 What Was and What Shall Be The imperfect and future tenses
  7. 19 Hic, Ille, Qui: the Pointing Words Demonstrative and relative pronouns
  8. 20 Unus, Duo, Tres: Numbers of the Spheres Cardinal and ordinal numbers
  9. 21 It Is Called: the Passive Voice Passive verbs and the agent
  10. 22 Things To Be Done: Participles and Gerundives Participles and the gerundive
  11. 23 Printed at Londinium: Title Pages and Colophons The Latin of imprints and printers
  12. 24 Agrippa's Threefold World Capstone: the opening of De Occulta Philosophia
Part III · Albedo Advanced Lessons 25–40
  1. 25 Let It Be: the Subjunctive The present subjunctive: wishes and exhortations
  2. 26 So That, and Lest: ut and ne Purpose clauses with the subjunctive
  3. 27 They Say That the Stone Is Indirect statement: accusative and infinitive
  4. 28 With the Thing Done: the Ablative Absolute The ablative absolute
  5. 29 Higher and Highest: Comparison Comparative and superlative adjectives
  6. 30 Verbs in Disguise: Deponents Deponent verbs: passive in form, active in meaning
  7. 31 To Be Able, To Wish, To Go, To Carry The irregular verbs possum, volo, eo, fero
  8. 32 If: Conditions Conditional sentences with si
  9. 33 The Words of the Work The vocabulary of alchemy
  10. 34 The Latin of the Horoscope Astrological terms
  11. 35 The Formulas of Conjuration The Latin of invocations
  12. 36 The Physician's Recipe The Latin of prescriptions and measures
  13. 37 Paracelsus's Motto Reading a sentence with every part of Part III
  14. 38 The Rosicrucian Vault Deponents and the future in the Fama Fraternitatis
  15. 39 Mottoes of the Adepts The gerund, and a sheaf of maxims
  16. 40 The Emerald Tablet Entire Capstone: the later lines of the Tabula Smaragdina
Part IV · Citrinitas Advanced Lessons 41–55
  1. 41 Had Been and Will Have Been The pluperfect and the future perfect
  2. 42 Were It So The imperfect and pluperfect subjunctive
  3. 43 When, Since, Although Clauses with cum
  4. 44 Ask What It Is Indirect questions
  5. 45 So Great That Result clauses
  6. 46 I Fear the Greeks Clauses of fearing and doubting
  7. 47 There Are Those Who Say Relative clauses of character and purpose
  8. 48 Wondrous to Tell The supine
  9. 49 It Is Permitted Impersonal verbs
  10. 50 Kalends, Nones and Ides Roman dates in colophons and letters
  11. 51 Letters That Hide a Year Roman numerals and chronograms
  12. 52 Long and Short Quantity and the dactylic hexameter
  13. 53 The Descent to Avernus Reading Aeneid 6: the Sibyl and the underworld
  14. 54 Pliny on the Fraud of Magic Reading the Natural History, book 30
  15. 55 The Square of the Sower Capstone: the Sator square
Part V · Rubedo Master Lessons 56–70
  1. 56 Our Father Who Art in Heaven Reading the Pater Noster
  2. 57 The Day of Wrath Reading the Dies Irae
  3. 58 O Fortune, Like the Moon Reading the Carmina Burana
  4. 59 Isidore on the Magi Reading the Etymologies of Isidore of Seville
  5. 60 The Great Miracle That Is Man The Asclepius and Pico's Oration
  6. 61 Life Drawn from the Heavens Ficino's De Vita and the spirit of the world
  7. 62 Let Him Be Silent or Learn John Dee's Monas Hieroglyphica
  8. 63 The Wind Carried It in Its Belly Michael Maier's Atalanta Fugiens
  9. 64 Names of the Healing Herbs The Latin of plant names
  10. 65 Take Up and Read Reading Augustine's Confessions
  11. 66 The Hours of the Sundial Mottoes of time
  12. 67 Thus Passes the Glory of the World Thomas à Kempis and the papal formula
  13. 68 How Aquinas Argued The Latin of the scholastic disputation
  14. 69 The Letters of Ramon Llull The nine dignities of the Ars Magna
  15. 70 Happy Who Knew the Causes Capstone: Virgil, Georgics 2
Greek · 70 lessons of 120 planned · Track

Greek of the Grimoires

Enough Greek to read the magical papyri, the books of Hermes and the first alchemists: the letters and their numbers, the cases, the verbs of calling and binding, the vowels and names of power, the opening of the Poimandres, an Orphic hymn to Hekate, the Gnostics, Pythagoras and the mysteries, the sayings of Heraclitus, then Homer's Circe and the shades, the Orphic gold leaves, Plato's cave, Plotinus, the Chaldean Oracles, the Mithras Liturgy, Theocritus' sorceress, Lucian's sorcerer's apprentice, and at last the death of great Pan. No code: questions and translations, judged by Xher.

Reader & Downloader members
Course outline 70 lessons in 5 parts
Part I · Prima Materia Beginner Lessons 1–12
  1. 1 The Letters of the Magical Papyri The Greek alphabet, alpha to mu
  2. 2 From Nu to the Great O The Greek alphabet, nu to omega
  3. 3 Breath and Pitch Breathings, accents and the iota subscript
  4. 4 Greek in Roman Dress Transliteration and the words it gave us
  5. 5 Letters That Count Greek numerals and isopsephy
  6. 6 The Little Word for The The article and grammatical gender
  7. 7 The Declension of Logos Second-declension nouns and the four cases
  8. 8 The Declension of Psyche First-declension nouns
  9. 9 I Am: The Verb To Be εἰμί and sentences with is
  10. 10 Verbs That Loose and Bind The present tense of -ω verbs
  11. 11 The Seven Wanderers The planets and their gods
  12. 12 Sayings Carved at Delphi Capstone: the Delphic maxims and "the All is One"
Part II · Nigredo Intermediate Lessons 13–24
  1. 13 Sacred, Good and Great Adjectives in three genders
  2. 14 In, Into, Out Of Prepositions and their cases
  3. 15 Fire, Light and Night The third declension
  4. 16 I Am the Headless One Personal pronouns and the ἐγώ εἰμι formula
  5. 17 The Middle Voice Middle and passive forms, and verbs that are only middle
  6. 18 In the Beginning Was The imperfect ἦν and the aorist
  7. 19 Come to Me: Commands and Summons The imperative and the language of invocation
  8. 20 Verbs That Contract Contract verbs in -έω and -άω
  9. 21 To Be and Being The infinitive and the participle
  10. 22 The Magician's Vocabulary The Greek words for magic and its makers
  11. 23 The Seven Vowels and the Ephesian Letters Vowel strings and words of power in the papyri
  12. 24 The Shepherd of Men Capstone: the opening of the Poimandres
Part III · Albedo Advanced Lessons 25–40
  1. 25 What Shall Be The future tense
  2. 26 It Is Written The perfect tense
  3. 27 The One Who Is, Who Was, Who Comes Participles as nouns, and the genitive absolute
  4. 28 Greater and Greatest Comparison of adjectives
  5. 29 So That, and If Ever The subjunctive
  6. 30 May It Be, and May It Not The optative and wishes
  7. 31 Tablets of Binding The Greek of curse tablets
  8. 32 The Hour-Watcher The Greek words of astrology
  9. 33 The Four Roots Empedocles, the elements and the fifth substance
  10. 34 The Gold-Makers' Greek The vocabulary of Greek alchemy
  11. 35 Hymn to the Lady of the Crossroads Reading an Orphic hymn to Hekate
  12. 36 The Word in the Beginning Reading the prologue of John
  13. 37 Names of the Gnostic Heavens The Greek of the Gnostics
  14. 38 The Fourfold Ten Pythagoras, the tetractys and the numbers
  15. 39 Words of the Mysteries Initiation, the mysteries and ecstasy
  16. 40 The Riddler of Ephesus Capstone: sayings of Heraclitus
Part IV · Citrinitas Advanced Lessons 41–55
  1. 41 City, Nature and Power Third-declension nouns with vowel stems
  2. 42 Kind, Darkness and End Neuter nouns in -ος, -ους
  3. 43 Who and Which The relative pronoun
  4. 44 This One and That One The demonstratives
  5. 45 Who Are You? Interrogatives and the indefinite
  6. 46 It Was Called: The Aorist Passive The aorist passive in -θη-
  7. 47 I Saw, I Came, I Found The second aorist
  8. 48 Give Me a Place to Stand Verbs in -μι
  9. 49 One, Seven and Ten Numbers in words
  10. 50 If the Gods Will Conditional sentences
  11. 51 Sing, Muse Homer and the epic hexameter
  12. 52 The Herb Called Moly Reading the Odyssey: Circe and the gods' herb
  13. 53 The Pit and the Shades Reading the Odyssey: the Nekyia
  14. 54 First of All, Chaos Reading Hesiod's Theogony
  15. 55 The Gold Leaves of the Initiates Capstone: the Orphic gold tablets
Part V · Rubedo Master Lessons 56–70
  1. 56 Prisoners in the Cave Reading Plato: the allegory of the cave
  2. 57 The World Is a Living Being Reading Plato's Timaeus
  3. 58 The Flight of the Alone to the Alone Reading Plotinus
  4. 59 The Flower of Mind Reading the Chaldean Oracles
  5. 60 Not by Thought Alone Reading Iamblichus On the Mysteries
  6. 61 I Am a Star Wandering with You Reading the Mithras Liturgy
  7. 62 The Vessels of Maria Mary the Jewess and the apparatus of alchemy
  8. 63 No One Is Wiser Reading Plato's Apology: Socrates and the oracle
  9. 64 Herodotus on the Magi Reading Herodotus: the Magi of Media
  10. 65 Hallowed Be Thy Name Reading the Lord's Prayer in Greek
  11. 66 Come to Me, Aphrodite Reading Sappho's hymn
  12. 67 Wryneck, Draw Him Home Reading Theocritus: the Sorceress
  13. 68 The Sorcerer's Apprentice Reading Lucian's Lover of Lies
  14. 69 While You Live, Shine Reading the epitaph of Seikilos
  15. 70 Great Pan Is Dead Capstone: Plutarch on the silence of the oracles
Hebrew · 70 lessons of 120 planned · Track

Hebrew of the Grimoires

Enough Hebrew to read the letters as the mystics read them, and the words of amulets and grimoires: the alphabet and its numbers, the mothers, doubles and simples of the Book of Formation, roots and verbs, the names of God and the angels, the Sefirot, Psalm 91, the thirty-two paths, the seventy-two names, the Golem and the silver scrolls, the Tree of Life in a verse of Chronicles, then the four worlds and the five names of the soul, the orchard of PaRDeS, Ezekiel's chariot and Jacob's ladder, Solomon's ring, the three angels of the childbirth amulet, the still small voice, the writing on the wall, the woman of Endor, the Urim and Thummim, and at last a time for everything. No code: questions and translations, judged by Xher.

Reader & Downloader members
Course outline 70 lessons in 5 parts
Part I · Prima Materia Beginner Lessons 1–12
  1. 1 The Letters from Aleph to Tet The Hebrew alphabet, aleph to tet; right to left
  2. 2 The Letters from Yod to Tav The Hebrew alphabet, yod to tav
  3. 3 The Five Letters That End Final forms and look-alike letters
  4. 4 Points Beneath the Letters The vowel points (niqqud)
  5. 5 Every Letter a Number Gematria: the letters as numbers
  6. 6 Mothers, Doubles and Simples The letters as the Book of Formation divides them
  7. 7 Roots of Three Letters The Hebrew root and the words it bears
  8. 8 Little Letters Before the Word The article and the one-letter prefixes
  9. 9 Angels, Stars and Letters Nouns: gender and the plural
  10. 10 Who Is Like God The names of the archangels
  11. 11 In the Beginning He Created Reading the first verse of Genesis
  12. 12 Let There Be Light Capstone: Genesis 1:3 and the light that is a secret
Part II · Nigredo Intermediate Lessons 13–24
  1. 13 I, You and There Is Personal pronouns, and sentences without "is"
  2. 14 My Name, Your Book Possessive endings
  3. 15 The House of God The construct state: "of" without a word
  4. 16 He Wrote, I Wrote The perfect: completed action
  5. 17 And He Said The imperfect, and the vav that turns time
  6. 18 Hear, Remember, Blessed Commands and the formula of blessing
  7. 19 Hear, O Israel Reading the Shema
  8. 20 I Will Be What I Will Be The names of God
  9. 21 The Ten Sefirot The names of the Tree of Life
  10. 22 Receiving the Tradition The words of the Kabbalah
  11. 23 Words for Amulets Notarikon: initials as words
  12. 24 In the Shelter of the Most High Capstone: Psalm 91, the psalm of protection
Part III · Albedo Advanced Lessons 25–40
  1. 25 Seven Shapes of a Verb The binyanim: verb patterns
  2. 26 The Writer and the Creator Participles and the present tense
  3. 27 Saying, To Say The infinitive
  4. 28 Ten Without What Numbers in words
  5. 29 Thirty-Two Wondrous Paths Reading the opening of Sefer Yetzirah
  6. 30 Atbash and the Ways of Gematria Letter-exchange ciphers
  7. 31 The Name of Seventy-Two The Shem ha-Meforash
  8. 32 Hebrew in the Latin Grimoires The names the Western magicians borrowed
  9. 33 Burning Ones and Wheels The orders of angels
  10. 34 Mazal and the Wanderers Hebrew names of the planets and the zodiac
  11. 35 Truth and the Golem The legend of the word emet
  12. 36 I Lift My Eyes to the Hills Reading Psalm 121
  13. 37 The Silver Scrolls The Priestly Blessing
  14. 38 Come and See: Aramaic The Aramaic of the Zohar and the Talmud
  15. 39 Reading Without the Points Unpointed Hebrew and the letters of reading
  16. 40 Yours Is the Greatness Capstone: the Sefirot in a verse of Chronicles
Part IV · Citrinitas Advanced Lessons 41–55
  1. 41 Go Forth: The Weak Roots Roots with weak letters
  2. 42 A Great Light Adjectives and agreement
  3. 43 Two Eyes, Two Hands, Two Wings The dual
  4. 44 Where Are You? Question words
  5. 45 What Has Been Will Be The relative: אֲשֶׁר and שֶׁ
  6. 46 Fear Not Negation: לֹא, אַל and אֵין
  7. 47 Male and Female He Created Them The object marker with endings
  8. 48 On the Seventh Day Ordinal numbers and the days of the week
  9. 49 Months That Came from Babylon The months of the Hebrew year
  10. 50 The Four Worlds Emanation, Creation, Formation and Action
  11. 51 Five Names of the Soul Nefesh, Ruach, Neshamah, Chayah, Yechidah
  12. 52 Four Who Entered the Orchard PaRDeS: the four ways of reading
  13. 53 Descenders to the Chariot Merkavah and Heikhalot mysticism
  14. 54 The Heavens Were Opened Reading Ezekiel's vision
  15. 55 A Ladder Set on the Earth Capstone: Jacob's dream
Part V · Rubedo Master Lessons 56–70
  1. 56 Holy of Holies The superlative by construct: the Song of Songs
  2. 57 One Language and One Speech Reading the Tower of Babel
  3. 58 Wisdom Has Built Her House Reading Proverbs: Wisdom personified
  4. 59 The Ring of Solomon Solomon, the demons and the seal
  5. 60 The Night Spirit and the Three Angels Lilith and the childbirth amulet
  6. 61 A Still Small Voice Reading Elijah at Horeb
  7. 62 The Writing on the Wall Reading Daniel: Mene, Mene, Tekel, Upharsin
  8. 63 The Woman of Endor Reading 1 Samuel 28: Saul and the medium
  9. 64 Diviners, Charmers and Mediums Reading the forbidden arts in Deuteronomy
  10. 65 Lights and Perfections The Urim and Thummim and the breastpiece
  11. 66 The Lampstand of Pure Gold Reading the Menorah in Exodus
  12. 67 A Spirit Passed Before My Face Reading Job: the night vision of Eliphaz
  13. 68 Arise, Shine Feminine commands: Isaiah 60 and the Sabbath Bride
  14. 69 The Heavens Declare Reading Psalm 19
  15. 70 A Time for Everything Capstone: Ecclesiastes 3
Logic · 40 lessons of 80 planned · Track

Logic & Puzzles

The reasoning behind every program, taught without one: syllogisms and the square of opposition, truth tables, knights and knaves, ordering and grid puzzles, sequences and the riddles of the Sphinx, then the fallacies, Lewis Carroll's chains, Llull's wheels, Pascal's dice, the Tower of Brahma, Agrippa's magic squares and the game of Nim, then Boole's algebra, Euler's bridges, Bayes's rule and the limits of reason. Questions answered on the page and judged by Xher.

Reader & Downloader members
Course outline 40 lessons in 3 parts
Part I · The First Syllogisms Beginner Lessons 1–12
  1. 1 Statements and Their Truth Propositions and negation
  2. 2 Not, And, Or Connectives
  3. 3 The Tables of Truth Truth tables and the exclusive or
  4. 4 The Conditional Oath If-then, converse, inverse, contrapositive
  5. 5 Arguments That Hold Valid and invalid forms
  6. 6 The Square of Opposition All, no, some
  7. 7 Circles of the Syllogism Syllogisms and Venn reasoning
  8. 8 The Isle of Knights and Knaves Knights and knaves
  9. 9 Seats at the Alchemists' Bench Ordering puzzles
  10. 10 The Grid of the Three Magi Elimination grids and caskets
  11. 11 Numbers of the Oracle Sequences and riddles
  12. 12 The Sphinx's Examination Everything together
Part II · The Labyrinth of Reason Intermediate Lessons 13–24
  1. 13 Fallacies of the Marketplace Informal fallacies
  2. 14 Lewis Carroll's Chains Sorites: chains of syllogisms
  3. 15 Three Circles Counted Counting with three overlapping sets
  4. 16 The Pigeon-Holes The pigeonhole principle
  5. 17 The Wheels of Ramon Llull Permutations and combinations
  6. 18 The Gambler's Question Probability: counting equally likely cases
  7. 19 The Doors of the Labyrinth Puzzles of true and false inscriptions
  8. 20 The Tower of Brahma Recursion and the doubling of moves
  9. 21 What Never Changes Invariants and parity
  10. 22 The Seals of the Planets Magic squares
  11. 23 The Game of Nim Winning and losing positions
  12. 24 The Labyrinth's Last Door Everything together
Part III · The Engines of Reason Advanced Lessons 25–40
  1. 25 Boole's Algebra of Thought Logic as arithmetic with 0 and 1
  2. 26 Gates of Brass Logic gates, NAND, and the half adder
  3. 27 Counting in Twos Binary numbers
  4. 28 Every and Some, in Order Quantifiers and their order
  5. 29 Proof by Contradiction Reductio ad absurdum
  6. 30 The Falling Dominoes Proof by induction
  7. 31 The Barber and the Catalogue Paradoxes of self-reference
  8. 32 Zeno's Race Infinite series that add up
  9. 33 The Seven Bridges Euler's paths and the degree of a vertex
  10. 34 Four Colours for Any Map Colouring graphs
  11. 35 The Prisoner's Dilemma Dominant strategies and equilibrium
  12. 36 Bayes and the Oracle Conditional probability and base rates
  13. 37 Boxes and Doors Paradoxes of probability
  14. 38 Letters for Digits Cryptarithms
  15. 39 The Limits of Reason Diagonal arguments, Gödel and Turing
  16. 40 The Engine's Examination Everything together