XCODX |

Befunge 93 Online Compiler & Interpreter

Select Language
Online Code Compiler
Full HTML IDE
Py main.py
Program Output Ready
  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.
Success
Operation completed

About Befunge 93

Befunge-93 is a 2D stack-based esoteric programming language created by Chris Pressey in 1993 as a deliberate attempt to design a language as hard to compile as possible. Instead of executing top-to-bottom like a normal program, the instruction pointer moves in two dimensions across an 80×25 grid of characters, with each character being either a stack operation, an arithmetic op, or a direction-changing arrow (>, <, ^, v). Programs can also rewrite themselves at runtime via the 'p' (put) and 'g' (get) instructions, which is what makes Befunge famously uncompilable. Run Befunge programs in this online interpreter — no cfunge, fungify, or Funge-98 setup required.

Hello World in Befunge 93

"!dlroW ,olleH">:#,_@

How it executes:
  "..."   pushes characters onto the stack in REVERSE order
  >       turns the instruction pointer rightward
  :       duplicates the top of the stack
  #       skips the very next instruction
  ,       pops and prints the top character
  _       horizontal IF: pop, go LEFT if non-zero else RIGHT
  @       end program

The loop prints each character of "Hello, World!\n" by
dupe-and-print, exiting the loop when the stack hits zero.

When to use Befunge 93

Use Befunge-93 for code-golf challenges, esolang competitions on sites like Code Golf Stack Exchange and anarchy golf, teaching unconventional control flow, mind-bending puzzle programming, and as a gateway to other 'fungeoid' languages (Funge-98, Befunge++, Cardinal, Trefunge). Befunge-93's 2D execution model is also a useful teaching tool for explaining why most modern languages chose 1D top-to-bottom execution — and what you give up by using a deliberately weird alternative.

Common questions

Why is Befunge famous?

It pioneered the 2D programming language concept and was specifically designed to be uncompilable — the 'p' instruction lets a program rewrite its own source mid-execution, so the only way to know what a program will do is to actually run it. This makes Befunge unusually loved by esoteric-language researchers, code golfers, and compiler-theory students who use it as a counter-example for static analysis.

What is the grid size in Befunge-93?

Befunge-93 uses a fixed 80×25 character playfield (the same dimensions as a classic VT100 terminal screen). The instruction pointer wraps around when it falls off an edge. Befunge-98 (the later spec) lifted this to an arbitrary-sized grid, but Befunge-93 keeps the original constraint and is what most online interpreters implement by default.

What are the direction-changing instructions?

> sends the pointer right, < left, ^ up, v down, and ? picks a random direction. _ is the horizontal IF: pop the stack, go right if zero else left. | is the vertical version. # skips the next instruction. @ ends the program. Everything else is either a digit (push 0-9), an arithmetic op (+ - * / %), or a stack manipulator (: dup, \ swap, $ pop, p put, g get).

How Befunge 93 runs on XCODX

Sandbox filename
main.bf
Entry point
single main source file
Editor grammar
plain text — no highlighter ships for this language
Reading stdin
~ or &
Input delivery
live WebSocket stream
Prompt flushing
flush manually before reading input
Compile limit
10 s
Run limit
3 s batch · up to 3 min live
Memory
256 MB per stage
Max source
50,000 characters

Default program on this page

>25*"!dlroW olleH",,,@