Lessons
D · Introductory
D · Introductory. Ten lessons. Open-book quizzes. Lesson 1 free.
10 lessons · The Host · Lesson 1 free
Pass all ten lessons for the certificate. Sample · Claim

Lesson 1 · On the house
Program structure
A D source file, main, imports from Phobos, writeln, and compiling with dmd, ldc2, or gdc.

Lesson 2
Variables and types
Built-in types with fixed sizes, auto inference, default initialization, const and immutable, and casts.

Lesson 3
Decisions
if/else, the ternary operator, switch on integers and strings, case ranges, and final switch.

Lesson 4
Loops
while, do-while, for, foreach over ranges and arrays with index, labeled break and continue.

Lesson 5
Functions
Passing parameters by value, ref, out, and in, plus default arguments, overloading, UFCS, and nested functions.

Lesson 6
Arrays and slices
Static arrays, dynamic arrays, slicing, appending with ~=, length, and bounds checks.

Lesson 7
Strings
string as immutable(char)[], UTF-8, concatenation, std.string helpers, std.format, and conversions.

Lesson 8
Associative arrays
Built-in hash maps: V[K], insert, in lookups, get with default, remove, keys, values, and iteration.

Lesson 9
Structs
Value types with fields, methods, constructors, default values, static members, and toString.

Lesson 10
Enums and modules
Named enums with base types, enum properties, std.conv for names, and splitting code into modules.
Sample certificate
Certificate of completion
Sign in to claim your certificate of completion.
Certificate
Finish all ten lessons, then sign in
Pass every lesson on this device (quizzes and checks). Then sign in or create an account to type your name and download the JPG.