Draft:Formaldehyde
From Esolanging
Jump to navigationJump to search
Formaldehyde is an esoteric programming language by User:AnalysisOfVariance in 2026 based on Iterate.
Overview
There is a tree that starts with one node.
Structures
() is a plain scope. []. {}. <>.
| Structure | Description |
|---|---|
~ |
Creates a new child node and moves the scope's focus to the child node. When the scope ends, the selected node goes back to the parent. |
; |
Loops forever. |
: |
Loops N times where N is the index of the current node using breadth-first search from the root. |
Commands
| Command | Description |
|---|---|
| Tree operations | |
<
|
Move to the previous index node using breadth-first search. If the currently selected node is the root, then the last node is selected. |
>
|
Move to the node with the next index using breadth-first search. If the currently selected node is the last node, then the root is selected. |
| Loop/scope operations | |
'
|
Breaks out of the current scope. |
| I/O commands | |
!
|
Outputs the current node's index starting from zero using breadth-first search from the root as an integer. |
$
|
Outputs the current node's index starting from zero using breadth-first search from the root as a UTF-32 codepoint modulo the maximum valid Unicode character's codepoint plus one. |
Examples
XKCD Random Number
~( @ 0
~( @ 1
~( @ 2
~( @ 3
~( @ 4
!
)
)
)
)
)
Truth-machine
!:(;(!))