Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Urban Müller wrote Brainfuck in 1993 while trying to build the smallest possible compiler for the Amiga, and its eight commands have defined the Turing tarpit genre ever since. The language exposes nothing but a tape of memory cells, a data pointer, and single-character instructions for moving, incrementing, looping, and byte I/O. It is the canonical first stop on the Esolang wiki, a fixture on Anarchy Golf and Code Golf Stack Exchange, and the ancestor of countless derivative languages. Running it on XCODX means a real terminal rather than a static output box: the comma instruction blocks on stdin, and you type your input live while the tape program is executing.
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
How it works: nested loops seed a few tape cells with useful starting values near the ASCII letter ranges; the pointer then walks from cell to cell nudging each value slightly before printing so every character of the greeting costs only a handful of instructions!
Brainfuck remains a rite of passage for esolang explorers and a live category on Anarchy Golf, where shaving single instructions off a solution is the whole sport. It is widely used in CS teaching to demonstrate Turing completeness from almost nothing, and writing a Brainfuck interpreter is itself a classic exercise. Golfers also study cell-value arithmetic here before tackling constant-generation problems in other tarpit languages.
Yes, given an unbounded tape. The combination of increment, decrement, pointer movement, and the conditional loop bracket pair is enough to simulate any Turing machine, which has been formally shown via translations from other complete models. Practical interpreters use finite tapes, commonly 30,000 cells, which is ample for real programs including compilers and interpreters written in Brainfuck itself.
The comma command reads one byte from stdin into the current cell. Implementations differ on end-of-file behavior, typically storing 0, storing 255, or leaving the cell unchanged, so golfers check which convention an interpreter uses. In the XCODX terminal the read is genuinely interactive: execution pauses at the comma until you type a character.
Because reaching a value like 72 with bare plus signs costs 72 instructions. A loop acts as multiplication, so a counter of 8 that adds 9 to a neighbor builds 72 in far fewer commands. Golfed programs set up several cells at once inside one loop, then make small adjustments per character, which is why competitive hello worlds hover around one hundred instructions.
> and < move the data pointer right and left along the tape; + and - increment and decrement the current cell; . outputs the current cell as a byte and , reads one byte in; and [ and ] form a loop that runs while the current cell is nonzero. Every other character is a comment. That's the entire language: eight symbols, no variables, no names.
In most Brainfuck implementations a cell holds a single byte, so values wrap around modulo 256: incrementing past 255 returns to 0, and decrementing below 0 gives 255. Golfers exploit this wraparound to reach values like 255 with one - from zero. Cell size is a main portability difference between interpreters, alongside tape length and EOF handling.
There are no variable names, no line labels, and no output beyond the bytes you print, so the whole program state is a tape position and cell values you must track in your head. A stray + or a mismatched bracket silently changes everything downstream. That opacity is the point: it's a Turing tarpit, valued for the challenge rather than for maintainable code.
main.bftext/x-brainfuck,++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.