Learn Nim from your first echo to a small project, writing clean, fast, statically typed code with every exercise checked as you go.
8 lessons, 16 exercises. Runs Nim 2.2.
Not started
Hello, output
Print text with echo and stdout.write, add comments, and see how Nim turns your file into a running program.
Values and variables
Meet Nim's basic types and the three ways to name a value, var, let and const, and build text from values.
Reading input and arithmetic
Read lines from standard input, turn text into numbers with strutils, and do maths with Nim's operators.
Making decisions
Choose between paths with if, elif, else and case, and combine conditions with comparison and boolean operators.
Loops
Repeat work with for loops over ranges, while loops, and break and continue for early exits.
Functions
Write procedures with typed parameters and return values, use result and return, and learn what a procedure can see.
Collections
Store many values in arrays, seqs and tables, and process them with Nim's standard library.
Strings and a small project
Index, slice and transform strings with strutils, then combine everything so far into a receipt printer.
Your progress is saved in this browser. Sign in to keep it on every device.