Brainf**k Game Engine

Memory

Only first 2048 cells are shown.

Brainf**k Tutorial

Brainf**k is a programming language with only 8 commands:

  • > Move pointer right
  • < Move pointer left
  • + Increment memory at pointer
  • - Decrement memory at pointer
  • . Output character at pointer
  • , Input character to pointer (from Input)
  • [ Jump forward past matching ] if memory at pointer is 0
  • ] Jump back to matching [ if memory at pointer is not 0

How to Use This UI

  • Write Brainf**k code in the Code tab.
  • Click Run to execute, Stop to halt, Reset to clear memory/output/screen.
  • Use the Input field for , commands
  • View memory in the Memory tab.
  • Game Mode: When enabled, the first 256 memory cells are visualized as a 16x16 pixel screen (see below). The . command updates the screen, instead of printing a character to the output.
  • When Game Mode is off, . prints to the output.
  • When Color Screen is enabled, the screen is colored (see below), else the screen is grayscale (0 - 255).

Colors Legend

Each value (0-255) is mapped to a unique color: 16 hues × 16 brightnesses.
Hue = value % 16, Brightness = value / 16. Used for Color Screen mode.

Brainf**k Examples

Hello World

Prints "Hello World!" to the output.

Fill the screen with all colors

Fills the first 256 memory cells with values 0 to 255 (for visualizing the full color palette in Game Mode).

Reverse Input

Reads a string from input and prints it in reverse order.

"The Parrot"

Says the same thing back to you. (Don't run in game mode)

Draw a Diagonal Line

Draws a diagonal line on the 16x16 screen in Game Mode.

Draw a Circle

(Not yet solved 😒)

Draws a circle on the 16x16 screen in Game Mode.

Draw a Checkerboard Pattern

Fills the screen with a checkerboard pattern in Game Mode.

A dot that moves with WASD

(Not yet solved 😒)

Moves a dot around the screen using the WASD keys.