needmoreeasy EN 한국어
Learn

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.

  1. 01 — Hello: say your first words
  2. 02 — Story: writing many lines without repeating yourself
  3. 03 — Story: letters arriving one at a time
  4. 04 — Ask: have a conversation
  5. 05 — Set: store a value
  6. 06 — Update: change a value
  7. 07 — Repeat: do something many times
  8. 08 — If: make a choice
  9. 09 — And / Or: combine conditions
  10. 10 — While: keep going
  11. 11 — Break: stop a loop
  12. 12 — Random: dice and picks
  13. 13 — Chance: how often out of a hundred
  14. 14 — Screen: clearing, ruling and boxing
  15. 15 — Time: a stopwatch and cooldowns
  16. 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.

  1. 17 — Word guess: a hidden-word game
  2. 18 — Adventure — a small text game
  3. 19 — Game: how fast are you?
  4. 20 — ASCII art — drawing with characters
  5. 21 — Progress — showing how far along you are
  6. 22 — Terminal menu — a small TUI
  7. 23 — High score: a small project
  8. 24 — Quiz: asking questions and marking them
  9. 25 — Calculator: asking and working it out
  10. 26 — Game: tic-tac-toe
  11. 27 — Game: guessing a hidden set of colours
  12. 28 — Game: an opponent that knows the rule
  13. 29 — Playlist: shuffling the order once
  14. 30 — Shop: stock and a balance
  15. 31 — Bank: paying in, taking out, keeping a history
  16. 32 — Grade book: a score per name, and an average
  17. 33 — Habit tracker: a mark for each day
  18. 34 — Chart: seeing numbers as bars
  19. 35 — Todo list: adding, dropping, listing
  20. 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.

  1. 37 — Files: saving and reading again
  2. 38 — Name list: reading a file line by line
  3. 39 — JSON: save and load data
  4. 40 — CSV: several fields on one line
  5. 41 — Records: a small address book
  6. 42 — Word count: how often each word appears
  7. 43 — Text stats: letters, words, and the longest one
  8. 44 — Log: an event record
  9. 45 — Group: data by category
  10. 46 — Top ten: ranking records
  11. 47 — Search — finding items in JSON
  12. 48 — Files: processing many files
  13. 49 — Report — writing a summary file
  14. 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.

  1. 51 — Text: counting, splitting, joining again
  2. 52 — Sorting — putting a list in order
  3. 53 — Sets: unique values
  4. 54 — Merge: joining two lists
  5. 55 — Grid: a board of lists
  6. 56 — Bubble sort — your first algorithm
  7. 57 — Binary search — halving the guess
  8. 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.

  1. 59 — Errors: handling problems
  2. 60 — Testing: checking the functions you wrote
  3. 61 — Modules: split your program into files
  4. 62 — Modules: a project across files
  5. 63 — Tools: reading command-line arguments
  6. 64 — Python packages: the standard library and installed libraries
  7. 65 — Convert: turn Python into NME
  8. 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.

  1. 67 — Stats: understanding data
  2. 68 — Compare: two groups of numbers
  3. 69 — Data: analyzing a month of temperatures
  4. 70 — Patterns: finding matches with regex
  5. 71 — HTTP — asking a web server
  6. 72 — Weather: reading JSON from the web
  7. 73 — Network: polling a server
  8. 74 — Network: downloading files
  9. 75 — Web: extracting links from a page
  10. 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.

  1. 77 — Your first compiler — a tiny language
  2. 78 — Compiler tier: a small expression language
  3. 79 — Compiler tier: reading tokens
  4. 80 — Compiler tier: expressions as trees
  5. 81 — Compiler tier: functions in the mini language
  6. 82 — Compiler tier: a tiny bytecode runner
  7. 83 — Compiler tier: from tree to bytecode
  8. 84 — Bootstrap: NME compiling a tiny language
  9. 85 — Self-host: NME running NME
  10. 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.

  1. 87 — Cryptocurrency ledger — state and transactions
  2. 88 — Proof of work — mining transaction blocks
  3. 89 — Transaction proofs — wallet ownership and replay prevention
  4. 90 — Full-chain validation — recompute from genesis

Topic lookup

All guides

#DifficultyTopicTitleResult
01★☆☆☆☆first stepsHello: say your first wordsa program that puts what you wrote on the screen
02★☆☆☆☆first stepsStory: writing many lines without repeating yourselfa program that tells a story of several lines in one block
03★☆☆☆☆first stepsStory: letters arriving one at a timea program whose text appears one letter at a time, the way a novel unfolds
04★☆☆☆☆first stepsAsk: have a conversationa program that asks a name and greets it in a sentence
05★☆☆☆☆first stepsSet: store a valuea program that keeps text, numbers and lists in named values
06★☆☆☆☆first stepsUpdate: change a valuea program that adds to and subtracts from a score
07★★☆☆☆first stepsRepeat: do something many timesa program that repeats lines, walks a list, and pauses
08★★☆☆☆choosing and repeatingIf: make a choicea program that runs different lines depending on a condition
09★★☆☆☆choosing and repeatingAnd / Or: combine conditionsa program that judges combined conditions
10★★☆☆☆choosing and repeatingWhile: keep goinga block that loops while a condition is true
11★★☆☆☆choosing and repeatingBreak: stop a loopa program that leaves a loop early
12★★☆☆☆random and chanceRandom: dice and picksa program that rolls a die and picks a color
13★★☆☆☆random and chanceChance: how often out of a hundreda program in which something happens only as often as you decided
14★★☆☆☆screen and timeScreen: clearing, ruling and boxinga program that clears the screen, centres a title and draws a box
15★★☆☆☆using the toolsTime: a stopwatch and cooldownsa program that times itself and stops an action from repeating too soon
16★★☆☆☆using the toolsCheck & Build: see the Pythonthe habit of reading the Python your sentences become
17★★★☆☆gamesWord guess: a hidden-word gamea game of guessing a hidden word one letter at a time
18★★★★☆projectsAdventure — a small text gamea room-by-room text adventure with choices
19★★★☆☆gamesGame: how fast are you?a program that measures how fast you react
20★★★☆☆screen and timeASCII art — drawing with charactersa program that draws shapes by repeating a character
21★★★☆☆screen and timeProgress — showing how far along you areworking through a list of jobs while a bar grows to show the progress
22★★★★☆projectsTerminal menu — a small TUIa menu program that clears the screen and draws it again
23★★★☆☆projectsHigh score: a small projecta dice game of three rounds that tells you your best
24★★★☆☆gamesQuiz: asking questions and marking thema quiz that asks each question in turn, marks the answers, and reports a score
25★★★☆☆projectsCalculator: asking and working it outa calculator that asks for two numbers and a operation, and says the answer
26★★★★☆gamesGame: tic-tac-toea playable two-player tic-tac-toe with a win check
27★★★☆☆gamesGame: guessing a hidden set of coloursguessing the three colours the computer hid, in five tries
28★★★★☆gamesGame: an opponent that knows the rulea game against an opponent that follows a winning rule
29★★★☆☆random and chancePlaylist: shuffling the order onceshuffling a list of songs and playing through it one at a time
30★★★★☆projectsShop: stock and a balancea small shop where every sale takes one off the stock and ten off the money
31★★★☆☆projectsBank: paying in, taking out, keeping a historyan account that pays in, takes out, protects the balance and records what happened
32★★★★☆projectsGrade book: a score per name, and an averagea grade book holding a score per name, reporting the average and the best
33★★★★☆projectsHabit tracker: a mark for each daykeeping a yes or no for each date and counting the days it was done
34★★★☆☆screen and timeChart: seeing numbers as barsdrawing how much was read each day as bars, so the days compare at a glance
35★★★★☆projectsTodo list: adding, dropping, listinga list that keeps taking commands to add, drop and show what needs doing
36★★★☆☆filesDiary: writing it down with today's datesaving a one-line diary entry stamped with today's date and weekday, then reading it back
37★★★☆☆filesFiles: saving and reading againa program that writes text to a file and reads it back
38★★★☆☆filesName list: reading a file line by linea program that saves names one per line and reads them back as a list
39★★★☆☆filesJSON: save and load dataa program that saves a name and a score and loads them back
40★★★☆☆filesCSV: several fields on one linea program that reads a file of comma-separated fields
41★★★☆☆working with dataRecords: a small address bookan address book that finds where someone lives by their name
42★★★★☆lists and textWord count: how often each word appearssplitting text into words and counting how many times each one appears
43★★★☆☆lists and textText stats: letters, words, and the longest onereading a saved file back and reporting its letters, its words, and its longest word
44★★★★★filesLog: an event recordappending a dated line to a log file each time the program runs, using datetime and file_write
45★★★★★working with dataGroup: data by categorygrouping a list of dicts by a category key into a dict of lists, then reporting counts per category
46★★★★★working with dataTop ten: ranking recordsloading JSON records, sorting by a numeric score with sorted(..., key=...), and showing the top ten
47★★★★★working with dataSearch — finding items in JSONloading a JSON catalog from a local server or file and searching it by keyword, case-insensitively
48★★★★★filesFiles: processing many fileslisting the files in a folder with os.listdir, reading each with file_read, and reporting total words and letters across all of them
49★★★★★projectsReport — writing a summary filereading a few JSON data files and writing one text report with file_write
50★★★★★projectsEditor — a tiny text editora line-based editor with a buffer and add, list, remove, save, and quit commands
51★★★☆☆lists and textText: counting, splitting, joining againcounting the letters in a sentence, splitting it into words, and joining it back into one line
52★★★☆☆lists and textSorting — putting a list in orderstanding a list up in both directions, smallest first and biggest first
53★★★★★lists and textSets: unique valuesusing a Python set to find unique words in a text file, then unique letters in a sentence
54★★★★★working with dataMerge: joining two listsloading two JSON lists and joining records by name key into one report
55★★★★★lists and textGrid: a board of listsa tic-tac-toe style 3x3 board stored as a list of lists, reading and writing cells with board[row][col]
56★★★★★lists and textBubble sort — your first algorithmimplementing bubble sort by hand with nested loops and a swap, then comparing the result with Python's built-in sort
57★★★★★lists and textBinary search — halving the guessfinding a number in a sorted list by halving the search range each step, showing the step count and the found index
58★★★★★working with dataData: statistics on a listloading numbers from a JSON file and computing mean/median/max with the statistics standard library
59★★★★☆when a program growsErrors: handling problemsa program that reads a missing file and converts bad input without crashing
60★★★★☆when a program growsTesting: checking the functions you wrotea tiny test runner that calls your own functions, compares each result with the expected value, and reports pass or fail
61★★★★☆when a program growsModules: split your program into filessplitting a program across .nme files
62★★★★☆when a program growsModules: a project across filesa small weather-report project split into three .nme modules (fetch, analyze, report) with clear interfaces, imported by a main program
63★★★★☆using the toolsTools: reading command-line argumentsa todo tool that takes commands like nme r todo add "buy milk" on the command line
64★★★★☆when a program growsPython packages: the standard library and installed librariesusing the standard library and installed libraries
65★★★★☆using the toolsConvert: turn Python into NMEa small Python file converted into NME
66★★★★☆using the toolsNative: compile to machine coderunning a program as machine code without CPython
67★★★★★working with dataStats: understanding dataloading a JSON list and reporting count, mean, median, mode, min, max, and range
68★★★★★working with dataCompare: two groups of numbersloading two JSON number lists and comparing their means and maxima
69★★★★★working with dataData: analyzing a month of temperaturesloading a month of temperatures, computing statistics and a histogram, and saving a report file
70★★★★★the internetPatterns: finding matches with regexa program that finds phone numbers and email addresses in a text file
71★★★★★the internetHTTP — asking a web serverfetching a page from a local server
72★★★★★the internetWeather: reading JSON from the webfetching a local HTTP server's JSON and printing a mini weather report
73★★★★★the internetNetwork: polling a serverrepeatedly fetching a status.json from a local server every few seconds and reporting changes
74★★★★★the internetNetwork: downloading filesdownloading a file from a local HTTP server and saving it while showing progress
75★★★★★the internetWeb: extracting links from a pagefetching an HTML page from a local server and listing every link on it as a full URL
76★★★★★the internetNetwork: a mini chatfetching messages from a local HTTP server and showing them like a mini chat
77★★★★☆building a languageYour first compiler — a tiny languagea tiny language that reads lines like add 2 3 and prints the answer
78★★★★☆building a languageCompiler tier: a small expression languagea tiny calculator that evaluates 2 + 3 * 4 respecting precedence, as a step toward a real expression compiler
79★★★★☆building a languageCompiler tier: reading tokenssplitting a command line into tokens and dispatching them, a step toward a real tokenizer and parser
80★★★★★building a languageCompiler tier: expressions as treesa calculator that parses an expression into a tree and evaluates the tree recursively, respecting precedence
81★★★★★building a languageCompiler tier: functions in the mini languagea compiler that translates a mini language with def, return, and calls into Python and runs it
82★★★★★building a languageCompiler tier: a tiny bytecode runnercompiling simple instructions into a list of steps and running them one by one like a tiny virtual machine
83★★★★★building a languageCompiler tier: from tree to bytecodea compiler that flattens an expression tree into instruction lines and runs them on a stack machine
84★★★★★building a languageBootstrap: NME compiling a tiny languagea tiny compiler written in NME
85★★★★★building a languageSelf-host: NME running NMEan NME program that compiles a tiny NME-like subset (say/set/while) to Python
86★★★★★building a languageCapstone: a language that compiles to Pythonan 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★★★☆☆cryptocurrencyCryptocurrency ledger — state and transactionsa small cryptocurrency ledger with balances, fees, supply, and transaction nonces
88★★★☆☆cryptocurrencyProof of work — mining transaction blockslink transactions to the previous block and perform SHA-256 proof of work
89★★★☆☆cryptocurrencyTransaction proofs — wallet ownership and replay preventionvalidate transaction authorization with a public value and reject replay
90★★★☆☆cryptocurrencyFull-chain validation — recompute from genesisa 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

90 guides