An interactive command-line tool for learning and mastering the Brainfuck programming language.
# Automated setup
./setup.sh
# Or manual installation
npm install
npm link # Makes 'bf' command available globallybrainfuck-cli/
├── bin/ # Executable scripts
│ └── bf # Main CLI executable
├── src/ # Source code
│ ├── cli.js # CLI interface
│ ├── interpreter.js # Brainfuck interpreter
│ ├── tutorial.js # Interactive tutorial
│ ├── examples.js # Example programs
│ ├── exercises.js # Practice exercises
│ ├── visualizer.js # Memory visualization
│ └── config.js # Configuration
├── data/ # Data files
│ ├── examples/ # Example .bf files
│ └── exercises/ # Exercise data
├── tests/ # Test files
└── package.json # NPM configuration
bf run hello.bf
bf run hello.bf -i "input string" # With input
bf run hello.bf -d # Debug mode
bf run hello.bf -v # With visualizationbf exec "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++."
bf exec ",[.,]" -i "Hello"bf tutorialbf examplesbf exercise # Choose difficulty
bf exercise beginner # Start beginner exercisesbf debug program.bfbf generate "Hello World"bf visualize "+++++[->+<]"| Command | Description |
|---|---|
run <file> |
Execute a Brainfuck file |
exec <code> |
Execute Brainfuck code directly |
tutorial |
Start interactive tutorial |
examples |
Browse and run example programs |
exercise [level] |
Practice with exercises |
debug <file> |
Step-through debugger |
generate <text> |
Generate BF code for text |
visualize <code> |
Animate code execution |
| Command | Description |
|---|---|
> |
Move pointer right |
< |
Move pointer left |
+ |
Increment current cell |
- |
Decrement current cell |
. |
Output ASCII character |
, |
Input one byte |
[ |
Jump to ] if cell is 0 |
] |
Jump to [ if cell is not 0 |
- ✅ Full Brainfuck interpreter
- ✅ Interactive tutorial with 10 lessons
- ✅ 40+ example programs from the guide
- ✅ Progressive exercises (beginner to advanced)
- ✅ Memory visualization
- ✅ Step-by-step debugger
- ✅ Code generation from text
- ✅ Execution animation
- ✅ Comprehensive test suite
- Hello World
- Cat (Echo)
- Clear Cell
- Move Value
- Add Numbers
- Multiplication
- Fibonacci
- Uppercase/Lowercase converter
- Bubble Sort
- PI Calculator
- Powers of Two
- 99 Bottles of Beer
- Factorial Calculator
- Start with
bf tutorialto learn basics - Practice with
bf exercise beginner - Explore
bf examplesto see real programs - Use
bf debugto understand complex programs - Challenge yourself with advanced exercises
This tool implements concepts and examples from the comprehensive Brainfuck guide, making it easy to learn through hands-on practice.