NME learning guides
90 short guides, written to be read in order and grouped into eight parts. Each one teaches a single idea and ends with something to try and a summary of what it taught.
Nothing needs installing. Every code block has a "run it" link that carries the program into the writing box on needmoreeasy.com, phone included. Every program printed here has been through the real compiler.
Difficulty
- ★☆☆☆☆ (1/5) — first day. A few sentences and it is done.
- ★★☆☆☆ (2/5) — conditions and loops appear. Still sentences only.
- ★★★☆☆ (3/5) — a whole program of your own.
- ★★★★☆ (4/5) — beginner syntax or Python is mixed in.
- ★★★★★ (5/5) — essentially Python.
The star is how hard it is, not the order of the numbers. Every part starts again with the easiest guide of its subject, and inside a part a guide rewritten in sentences gets easier by that much.
How far the sentence-only guides go can be measured at any time:
python3 scripts/report-guide-tier.py --guides
Learn in order
Part 1 — Starting with sentences
For someone who has never written a program: sentences only, one new idea per guide.
- 01 — Hello: say your first words
- 02 — Story: writing many lines without repeating yourself
- 03 — Story: letters arriving one at a time
- 04 — Ask: have a conversation
- 05 — Set: store a value
- 06 — Update: change a value
- 07 — Repeat: do something many times
- 08 — If: make a choice
- 09 — And / Or: combine conditions
- 10 — While: keep going
- 11 — Break: stop a loop
- 12 — Random: dice and picks
- 13 — Chance: how often out of a hundred
- 14 — Screen: clearing, ruling and boxing
- 15 — Time: a stopwatch and cooldowns
- 16 — Check & Build: see the Python
Part 2 — Small programs you can build
For someone who has finished Part 1 and wants games, menus and small projects
to keep. Eighteen of the twenty are written in sentences alone — no
quote, no bracket, no equals sign. The two that are not are 26, which needs a
list of lists, and 36, which writes a date out by hand between quotes. The
guides written in sentences alone are Part 1 — its code contains no quote, no
bracket and no equals sign, which scripts/report-guide-tier.py measures.
- 17 — Word guess: a hidden-word game
- 18 — Adventure — a small text game
- 19 — Game: how fast are you?
- 20 — ASCII art — drawing with characters
- 21 — Progress — showing how far along you are
- 22 — Terminal menu — a small TUI
- 23 — High score: a small project
- 24 — Quiz: asking questions and marking them
- 25 — Calculator: asking and working it out
- 26 — Game: tic-tac-toe
- 27 — Game: guessing a hidden set of colours
- 28 — Game: an opponent that knows the rule
- 29 — Playlist: shuffling the order once
- 30 — Shop: stock and a balance
- 31 — Bank: paying in, taking out, keeping a history
- 32 — Grade book: a score per name, and an average
- 33 — Habit tracker: a mark for each day
- 34 — Chart: seeing numbers as bars
- 35 — Todo list: adding, dropping, listing
- 36 — Diary: writing it down with today's date
Part 3 — Files and data
For someone who wants a program to remember things after it stops: files, JSON, CSV and reports. Guides 37, 38, 40, 42 and 43 are written in sentences — except that a file name is wrapped in quotes. That is the only place sentence syntax uses them, and guide 37 says why.
⚠ From this part on, the programs do not run on the site. There is nowhere inside a browser to keep a file. Install NME and try them on your own computer.
- 37 — Files: saving and reading again
- 38 — Name list: reading a file line by line
- 39 — JSON: save and load data
- 40 — CSV: several fields on one line
- 41 — Records: a small address book
- 42 — Word count: how often each word appears
- 43 — Text stats: letters, words, and the longest one
- 44 — Log: an event record
- 45 — Group: data by category
- 46 — Top ten: ranking records
- 47 — Search — finding items in JSON
- 48 — Files: processing many files
- 49 — Report — writing a summary file
- 50 — Editor — a tiny text editor
Part 4 — More with lists and text
For someone handling longer lists and longer text: sorting, sets, grids and search order.
- 51 — Text: counting, splitting, joining again
- 52 — Sorting — putting a list in order
- 53 — Sets: unique values
- 54 — Merge: joining two lists
- 55 — Grid: a board of lists
- 56 — Bubble sort — your first algorithm
- 57 — Binary search — halving the guess
- 58 — Data: statistics on a list
Part 5 — When a program grows: errors, tests and files
For someone who wants shorter code and larger programs: beginner syntax, advanced syntax, modules and tools.
- 59 — Errors: handling problems
- 60 — Testing: checking the functions you wrote
- 61 — Modules: split your program into files
- 62 — Modules: a project across files
- 63 — Tools: reading command-line arguments
- 64 — Python packages: the standard library and installed libraries
- 65 — Convert: turn Python into NME
- 66 — Native: compile to machine code
Part 6 — Analysis and the internet
For someone with data to understand or a server to ask: statistics, patterns and the network.
- 67 — Stats: understanding data
- 68 — Compare: two groups of numbers
- 69 — Data: analyzing a month of temperatures
- 70 — Patterns: finding matches with regex
- 71 — HTTP — asking a web server
- 72 — Weather: reading JSON from the web
- 73 — Network: polling a server
- 74 — Network: downloading files
- 75 — Web: extracting links from a page
- 76 — Network: a mini chat
Part 7 — Building a language of your own
For someone who wants to know how a language is built: a compiler written step by step.
- 77 — Your first compiler — a tiny language
- 78 — Compiler tier: a small expression language
- 79 — Compiler tier: reading tokens
- 80 — Compiler tier: expressions as trees
- 81 — Compiler tier: functions in the mini language
- 82 — Compiler tier: a tiny bytecode runner
- 83 — Compiler tier: from tree to bytecode
- 84 — Bootstrap: NME compiling a tiny language
- 85 — Self-host: NME running NME
- 86 — Capstone: a language that compiles to Python
Part 8 — Cryptocurrency
For someone who wants to see what a cryptocurrency actually is: a ledger built and validated by hand.
- 87 — Cryptocurrency ledger — state and transactions
- 88 — Proof of work — mining transaction blocks
- 89 — Transaction proofs — wallet ownership and replay prevention
- 90 — Full-chain validation — recompute from genesis
Topic lookup
- first steps:01020304050607
- choosing and repeating:08091011
- random and chance: 12, 13, 29
- screen and time:14202134
- using the tools:1516636566
- games:171924262728
- projects:1822232530313233354950
- files:36373839404448
- working with data:414546475458676869
- lists and text:4243515253555657
- when a program grows:5960616264
- the internet:70717273747576
- building a language:77787980818283848586
- cryptocurrency:87888990
All guides
| # | Difficulty | Topic | Title | Result |
|---|---|---|---|---|
| 01 | ★☆☆☆☆ | first steps | Hello: say your first words | a program that puts what you wrote on the screen |
| 02 | ★☆☆☆☆ | first steps | Story: writing many lines without repeating yourself | a program that tells a story of several lines in one block |
| 03 | ★☆☆☆☆ | first steps | Story: letters arriving one at a time | a program whose text appears one letter at a time, the way a novel unfolds |
| 04 | ★☆☆☆☆ | first steps | Ask: have a conversation | a program that asks a name and greets it in a sentence |
| 05 | ★☆☆☆☆ | first steps | Set: store a value | a program that keeps text, numbers and lists in named values |
| 06 | ★☆☆☆☆ | first steps | Update: change a value | a program that adds to and subtracts from a score |
| 07 | ★★☆☆☆ | first steps | Repeat: do something many times | a program that repeats lines, walks a list, and pauses |
| 08 | ★★☆☆☆ | choosing and repeating | If: make a choice | a program that runs different lines depending on a condition |
| 09 | ★★☆☆☆ | choosing and repeating | And / Or: combine conditions | a program that judges combined conditions |
| 10 | ★★☆☆☆ | choosing and repeating | While: keep going | a block that loops while a condition is true |
| 11 | ★★☆☆☆ | choosing and repeating | Break: stop a loop | a program that leaves a loop early |
| 12 | ★★☆☆☆ | random and chance | Random: dice and picks | a program that rolls a die and picks a color |
| 13 | ★★☆☆☆ | random and chance | Chance: how often out of a hundred | a program in which something happens only as often as you decided |
| 14 | ★★☆☆☆ | screen and time | Screen: clearing, ruling and boxing | a program that clears the screen, centres a title and draws a box |
| 15 | ★★☆☆☆ | using the tools | Time: a stopwatch and cooldowns | a program that times itself and stops an action from repeating too soon |
| 16 | ★★☆☆☆ | using the tools | Check & Build: see the Python | the habit of reading the Python your sentences become |
| 17 | ★★★☆☆ | games | Word guess: a hidden-word game | a game of guessing a hidden word one letter at a time |
| 18 | ★★★★☆ | projects | Adventure — a small text game | a room-by-room text adventure with choices |
| 19 | ★★★☆☆ | games | Game: how fast are you? | a program that measures how fast you react |
| 20 | ★★★☆☆ | screen and time | ASCII art — drawing with characters | a program that draws shapes by repeating a character |
| 21 | ★★★☆☆ | screen and time | Progress — showing how far along you are | working through a list of jobs while a bar grows to show the progress |
| 22 | ★★★★☆ | projects | Terminal menu — a small TUI | a menu program that clears the screen and draws it again |
| 23 | ★★★☆☆ | projects | High score: a small project | a dice game of three rounds that tells you your best |
| 24 | ★★★☆☆ | games | Quiz: asking questions and marking them | a quiz that asks each question in turn, marks the answers, and reports a score |
| 25 | ★★★☆☆ | projects | Calculator: asking and working it out | a calculator that asks for two numbers and a operation, and says the answer |
| 26 | ★★★★☆ | games | Game: tic-tac-toe | a playable two-player tic-tac-toe with a win check |
| 27 | ★★★☆☆ | games | Game: guessing a hidden set of colours | guessing the three colours the computer hid, in five tries |
| 28 | ★★★★☆ | games | Game: an opponent that knows the rule | a game against an opponent that follows a winning rule |
| 29 | ★★★☆☆ | random and chance | Playlist: shuffling the order once | shuffling a list of songs and playing through it one at a time |
| 30 | ★★★★☆ | projects | Shop: stock and a balance | a small shop where every sale takes one off the stock and ten off the money |
| 31 | ★★★☆☆ | projects | Bank: paying in, taking out, keeping a history | an account that pays in, takes out, protects the balance and records what happened |
| 32 | ★★★★☆ | projects | Grade book: a score per name, and an average | a grade book holding a score per name, reporting the average and the best |
| 33 | ★★★★☆ | projects | Habit tracker: a mark for each day | keeping a yes or no for each date and counting the days it was done |
| 34 | ★★★☆☆ | screen and time | Chart: seeing numbers as bars | drawing how much was read each day as bars, so the days compare at a glance |
| 35 | ★★★★☆ | projects | Todo list: adding, dropping, listing | a list that keeps taking commands to add, drop and show what needs doing |
| 36 | ★★★☆☆ | files | Diary: writing it down with today's date | saving a one-line diary entry stamped with today's date and weekday, then reading it back |
| 37 | ★★★☆☆ | files | Files: saving and reading again | a program that writes text to a file and reads it back |
| 38 | ★★★☆☆ | files | Name list: reading a file line by line | a program that saves names one per line and reads them back as a list |
| 39 | ★★★☆☆ | files | JSON: save and load data | a program that saves a name and a score and loads them back |
| 40 | ★★★☆☆ | files | CSV: several fields on one line | a program that reads a file of comma-separated fields |
| 41 | ★★★☆☆ | working with data | Records: a small address book | an address book that finds where someone lives by their name |
| 42 | ★★★★☆ | lists and text | Word count: how often each word appears | splitting text into words and counting how many times each one appears |
| 43 | ★★★☆☆ | lists and text | Text stats: letters, words, and the longest one | reading a saved file back and reporting its letters, its words, and its longest word |
| 44 | ★★★★★ | files | Log: an event record | appending a dated line to a log file each time the program runs, using datetime and file_write |
| 45 | ★★★★★ | working with data | Group: data by category | grouping a list of dicts by a category key into a dict of lists, then reporting counts per category |
| 46 | ★★★★★ | working with data | Top ten: ranking records | loading JSON records, sorting by a numeric score with sorted(..., key=...), and showing the top ten |
| 47 | ★★★★★ | working with data | Search — finding items in JSON | loading a JSON catalog from a local server or file and searching it by keyword, case-insensitively |
| 48 | ★★★★★ | files | Files: processing many files | listing the files in a folder with os.listdir, reading each with file_read, and reporting total words and letters across all of them |
| 49 | ★★★★★ | projects | Report — writing a summary file | reading a few JSON data files and writing one text report with file_write |
| 50 | ★★★★★ | projects | Editor — a tiny text editor | a line-based editor with a buffer and add, list, remove, save, and quit commands |
| 51 | ★★★☆☆ | lists and text | Text: counting, splitting, joining again | counting the letters in a sentence, splitting it into words, and joining it back into one line |
| 52 | ★★★☆☆ | lists and text | Sorting — putting a list in order | standing a list up in both directions, smallest first and biggest first |
| 53 | ★★★★★ | lists and text | Sets: unique values | using a Python set to find unique words in a text file, then unique letters in a sentence |
| 54 | ★★★★★ | working with data | Merge: joining two lists | loading two JSON lists and joining records by name key into one report |
| 55 | ★★★★★ | lists and text | Grid: a board of lists | a tic-tac-toe style 3x3 board stored as a list of lists, reading and writing cells with board[row][col] |
| 56 | ★★★★★ | lists and text | Bubble sort — your first algorithm | implementing bubble sort by hand with nested loops and a swap, then comparing the result with Python's built-in sort |
| 57 | ★★★★★ | lists and text | Binary search — halving the guess | finding a number in a sorted list by halving the search range each step, showing the step count and the found index |
| 58 | ★★★★★ | working with data | Data: statistics on a list | loading numbers from a JSON file and computing mean/median/max with the statistics standard library |
| 59 | ★★★★☆ | when a program grows | Errors: handling problems | a program that reads a missing file and converts bad input without crashing |
| 60 | ★★★★☆ | when a program grows | Testing: checking the functions you wrote | a tiny test runner that calls your own functions, compares each result with the expected value, and reports pass or fail |
| 61 | ★★★★☆ | when a program grows | Modules: split your program into files | splitting a program across .nme files |
| 62 | ★★★★☆ | when a program grows | Modules: a project across files | a small weather-report project split into three .nme modules (fetch, analyze, report) with clear interfaces, imported by a main program |
| 63 | ★★★★☆ | using the tools | Tools: reading command-line arguments | a todo tool that takes commands like nme r todo add "buy milk" on the command line |
| 64 | ★★★★☆ | when a program grows | Python packages: the standard library and installed libraries | using the standard library and installed libraries |
| 65 | ★★★★☆ | using the tools | Convert: turn Python into NME | a small Python file converted into NME |
| 66 | ★★★★☆ | using the tools | Native: compile to machine code | running a program as machine code without CPython |
| 67 | ★★★★★ | working with data | Stats: understanding data | loading a JSON list and reporting count, mean, median, mode, min, max, and range |
| 68 | ★★★★★ | working with data | Compare: two groups of numbers | loading two JSON number lists and comparing their means and maxima |
| 69 | ★★★★★ | working with data | Data: analyzing a month of temperatures | loading a month of temperatures, computing statistics and a histogram, and saving a report file |
| 70 | ★★★★★ | the internet | Patterns: finding matches with regex | a program that finds phone numbers and email addresses in a text file |
| 71 | ★★★★★ | the internet | HTTP — asking a web server | fetching a page from a local server |
| 72 | ★★★★★ | the internet | Weather: reading JSON from the web | fetching a local HTTP server's JSON and printing a mini weather report |
| 73 | ★★★★★ | the internet | Network: polling a server | repeatedly fetching a status.json from a local server every few seconds and reporting changes |
| 74 | ★★★★★ | the internet | Network: downloading files | downloading a file from a local HTTP server and saving it while showing progress |
| 75 | ★★★★★ | the internet | Web: extracting links from a page | fetching an HTML page from a local server and listing every link on it as a full URL |
| 76 | ★★★★★ | the internet | Network: a mini chat | fetching messages from a local HTTP server and showing them like a mini chat |
| 77 | ★★★★☆ | building a language | Your first compiler — a tiny language | a tiny language that reads lines like add 2 3 and prints the answer |
| 78 | ★★★★☆ | building a language | Compiler tier: a small expression language | a tiny calculator that evaluates 2 + 3 * 4 respecting precedence, as a step toward a real expression compiler |
| 79 | ★★★★☆ | building a language | Compiler tier: reading tokens | splitting a command line into tokens and dispatching them, a step toward a real tokenizer and parser |
| 80 | ★★★★★ | building a language | Compiler tier: expressions as trees | a calculator that parses an expression into a tree and evaluates the tree recursively, respecting precedence |
| 81 | ★★★★★ | building a language | Compiler tier: functions in the mini language | a compiler that translates a mini language with def, return, and calls into Python and runs it |
| 82 | ★★★★★ | building a language | Compiler tier: a tiny bytecode runner | compiling simple instructions into a list of steps and running them one by one like a tiny virtual machine |
| 83 | ★★★★★ | building a language | Compiler tier: from tree to bytecode | a compiler that flattens an expression tree into instruction lines and runs them on a stack machine |
| 84 | ★★★★★ | building a language | Bootstrap: NME compiling a tiny language | a tiny compiler written in NME |
| 85 | ★★★★★ | building a language | Self-host: NME running NME | an NME program that compiles a tiny NME-like subset (say/set/while) to Python |
| 86 | ★★★★★ | building a language | Capstone: a language that compiles to Python | an NME program that reads a small custom language (say/set/add/while/end), compiles it to Python source, writes it to a file, and runs it |
| 87 | ★★★☆☆ | cryptocurrency | Cryptocurrency ledger — state and transactions | a small cryptocurrency ledger with balances, fees, supply, and transaction nonces |
| 88 | ★★★☆☆ | cryptocurrency | Proof of work — mining transaction blocks | link transactions to the previous block and perform SHA-256 proof of work |
| 89 | ★★★☆☆ | cryptocurrency | Transaction proofs — wallet ownership and replay prevention | validate transaction authorization with a public value and reject replay |
| 90 | ★★★☆☆ | cryptocurrency | Full-chain validation — recompute from genesis | a single-node validator that replays every transaction and block from genesis |
Where to continue
- Getting started: the five-minute path from hello to a number game
- Tutorial: seven projects from Hello World to a compiler
- Language reference: exact rules for all three levels
- Syntax list: every accepted spelling, in one table
- Prompts to hand to an AI: paste one into a chat and the AI can write NME
- If installing is hard, write and run programs at needmoreeasy.com — it works on a phone.
All 90 guides
- 01 — Hello: say your first wordsfirst steps★☆☆☆☆
- 02 — Story: writing many lines without repeating yourselffirst steps★☆☆☆☆
- 03 — Story: letters arriving one at a timefirst steps★☆☆☆☆
- 04 — Ask: have a conversationfirst steps★☆☆☆☆
- 05 — Set: store a valuefirst steps★☆☆☆☆
- 06 — Update: change a valuefirst steps★☆☆☆☆
- 07 — Repeat: do something many timesfirst steps★★☆☆☆
- 08 — If: make a choicechoosing and repeating★★☆☆☆
- 09 — And / Or: combine conditionschoosing and repeating★★☆☆☆
- 10 — While: keep goingchoosing and repeating★★☆☆☆
- 11 — Break: stop a loopchoosing and repeating★★☆☆☆
- 12 — Random: dice and picksrandom and chance★★☆☆☆
- 13 — Chance: how often out of a hundredrandom and chance★★☆☆☆
- 14 — Screen: clearing, ruling and boxingscreen and time★★☆☆☆
- 15 — Time: a stopwatch and cooldownsusing the tools★★☆☆☆
- 16 — Check & Build: see the Pythonusing the tools★★☆☆☆
- 17 — Word guess: a hidden-word gamegames★★★☆☆
- 18 — Adventure — a small text gameprojects★★★★☆
- 19 — Game: how fast are you?games★★★☆☆
- 20 — ASCII art — drawing with charactersscreen and time★★★☆☆
- 21 — Progress — showing how far along you arescreen and time★★★☆☆
- 22 — Terminal menu — a small TUIprojects★★★★☆
- 23 — High score: a small projectprojects★★★☆☆
- 24 — Quiz: asking questions and marking themgames★★★☆☆
- 25 — Calculator: asking and working it outprojects★★★☆☆
- 26 — Game: tic-tac-toegames★★★★☆
- 27 — Game: guessing a hidden set of coloursgames★★★☆☆
- 28 — Game: an opponent that knows the rulegames★★★★☆
- 29 — Playlist: shuffling the order oncerandom and chance★★★☆☆
- 30 — Shop: stock and a balanceprojects★★★★☆
- 31 — Bank: paying in, taking out, keeping a historyprojects★★★☆☆
- 32 — Grade book: a score per name, and an averageprojects★★★★☆
- 33 — Habit tracker: a mark for each dayprojects★★★★☆
- 34 — Chart: seeing numbers as barsscreen and time★★★☆☆
- 35 — Todo list: adding, dropping, listingprojects★★★★☆
- 36 — Diary: writing it down with today's datefiles★★★☆☆
- 37 — Files: saving and reading againfiles★★★☆☆
- 38 — Name list: reading a file line by linefiles★★★☆☆
- 39 — JSON: save and load datafiles★★★☆☆
- 40 — CSV: several fields on one linefiles★★★☆☆
- 41 — Records: a small address bookworking with data★★★☆☆
- 42 — Word count: how often each word appearslists and text★★★★☆
- 43 — Text stats: letters, words, and the longest onelists and text★★★☆☆
- 44 — Log: an event recordfiles★★★★★
- 45 — Group: data by categoryworking with data★★★★★
- 46 — Top ten: ranking recordsworking with data★★★★★
- 47 — Search — finding items in JSONworking with data★★★★★
- 48 — Files: processing many filesfiles★★★★★
- 49 — Report — writing a summary fileprojects★★★★★
- 50 — Editor — a tiny text editorprojects★★★★★
- 51 — Text: counting, splitting, joining againlists and text★★★☆☆
- 52 — Sorting — putting a list in orderlists and text★★★☆☆
- 53 — Sets: unique valueslists and text★★★★★
- 54 — Merge: joining two listsworking with data★★★★★
- 55 — Grid: a board of listslists and text★★★★★
- 56 — Bubble sort — your first algorithmlists and text★★★★★
- 57 — Binary search — halving the guesslists and text★★★★★
- 58 — Data: statistics on a listworking with data★★★★★
- 59 — Errors: handling problemswhen a program grows★★★★☆
- 60 — Testing: checking the functions you wrotewhen a program grows★★★★☆
- 61 — Modules: split your program into fileswhen a program grows★★★★☆
- 62 — Modules: a project across fileswhen a program grows★★★★☆
- 63 — Tools: reading command-line argumentsusing the tools★★★★☆
- 64 — Python packages: the standard library and installed librarieswhen a program grows★★★★☆
- 65 — Convert: turn Python into NMEusing the tools★★★★☆
- 66 — Native: compile to machine codeusing the tools★★★★☆
- 67 — Stats: understanding dataworking with data★★★★★
- 68 — Compare: two groups of numbersworking with data★★★★★
- 69 — Data: analyzing a month of temperaturesworking with data★★★★★
- 70 — Patterns: finding matches with regexthe internet★★★★★
- 71 — HTTP — asking a web serverthe internet★★★★★
- 72 — Weather: reading JSON from the webthe internet★★★★★
- 73 — Network: polling a serverthe internet★★★★★
- 74 — Network: downloading filesthe internet★★★★★
- 75 — Web: extracting links from a pagethe internet★★★★★
- 76 — Network: a mini chatthe internet★★★★★
- 77 — Your first compiler — a tiny languagebuilding a language★★★★☆
- 78 — Compiler tier: a small expression languagebuilding a language★★★★☆
- 79 — Compiler tier: reading tokensbuilding a language★★★★☆
- 80 — Compiler tier: expressions as treesbuilding a language★★★★★
- 81 — Compiler tier: functions in the mini languagebuilding a language★★★★★
- 82 — Compiler tier: a tiny bytecode runnerbuilding a language★★★★★
- 83 — Compiler tier: from tree to bytecodebuilding a language★★★★★
- 84 — Bootstrap: NME compiling a tiny languagebuilding a language★★★★★
- 85 — Self-host: NME running NMEbuilding a language★★★★★
- 86 — Capstone: a language that compiles to Pythonbuilding a language★★★★★
- 87 — Cryptocurrency ledger — state and transactionscryptocurrency★★★☆☆
- 88 — Proof of work — mining transaction blockscryptocurrency★★★☆☆
- 89 — Transaction proofs — wallet ownership and replay preventioncryptocurrency★★★☆☆
- 90 — Full-chain validation — recompute from genesiscryptocurrency★★★☆☆