Playground
Pseudocode Playground
Write or paste any algorithm in Forge Pseudocode — your own, or one from the lessons — give it inputs and run it. Then watch it execute line by line, or measure how its work grows as the input gets bigger.
Examples gallery
Classic algorithms from the lessons, ready to run. Open one, change it, break it, fix it. Each card also has its own link (playground.html#ex=…) you can share.
Quick reference
The language
Levitin-style pseudocode; blocks are set by indentation (4 spaces).
- Assign with
←(or<-);=means “is equal to”. for i ← 0 to n - 1 do,downto,for each x in S do,while … do,repeat … until …if … then … else if … else,andornot,divmod⌊x⌋⌈x⌉swap A[i] and A[j],return,print x, y- A header
A[0..n-1]bindsn;A[l..r]bindslandr.
Built-ins
length(A)array(n, fill)matrix(r, c, fill)append(L, x)minmaxabssqrtfloorceillog2- Stacks and queues:
pushpoptopenqueuedequeueisEmpty - Priority queues:
Q ← priorityQueue(),insert(Q, item, key),deleteMin(Q) - Maps and sets:
map()set()containsget(M, k, default) ∞,true/false,null
Inputs and links
- Numbers
42, lists[3, 1, 2], text"abc"(quotes optional for a single word), nested lists for graphs and matrices[[1, 2], [0], []],∞,null. - The 🎲 button next to an input makes random arrays, text and graphs of any size.
- Copy link packs your code and inputs into the address itself — nothing is uploaded.
- Your work is kept as a draft in this browser. Download .txt saves a copy.
New to the dialect? Start with Lesson 0 · Start here, then practise with graded problems in the Arena.