Learn WHITESPACE with Real Code Examples
Updated Nov 25, 2025
Code Sample Descriptions
1
Hello World in Whitespace
SSSTSTSSSLSSSTSTSSSLSSSTTSSSLSSSTTSSSLSSSTSTSSSLSSSTTSSSL
A 'Hello World' in Whitespace consists only of spaces, tabs, and newlines. Below is a textual representation using S (space), T (tab), and L (linefeed).
2
Whitespace Push Number
SSSSSTSSL // Push 5 onto stack
Pushes a number onto the stack.
3
Whitespace Duplicate Top
SSSTL // Duplicate top of stack
Duplicates the top item of the stack.
4
Whitespace Swap Top Two
SSTL // Swap top two stack elements
Swaps the top two elements of the stack.
5
Whitespace Addition
TSSSL // Add top two numbers
Adds the top two numbers of the stack.
6
Whitespace Subtraction
TSSSTL // Subtract top from second top
Subtracts the top number from the second top number.
7
Whitespace Print Character
TSTSSSL // Print top as char
Prints the top number as ASCII character.
8
Whitespace Label and Jump
SSSTLSSS // Label definition
TTSLSSS // Jump to label
Defines a label and jumps to it unconditionally.
9
Whitespace Conditional Jump
SSSTLSSS // Label definition
TSTLSSS // Jump if zero
Jumps to a label if top of stack is zero.