esolang

MarioLANG

The program is a Super Mario level. Mario walks over it, falls off ledges and rides elevators, and the items he touches are brainfuck.

Wh1teWolf, 2009 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 5 known programs · Hello World on Try It Online: identical · Test method

Run it

Expected: Q

The idea

Wh1teWolf made MarioLANG in 2009, inspired by RubE On Conveyor Belts. The source looks like a level: rows of = ground, | walls, # elevators, and Mario running across them. Underneath is brainfuck's tape. Every + or . Mario walks over or falls through is done, and loops are built from turning him around with < and >.

Read the story

There is no official interpreter and no exact spec. Try It Online runs T.J.S.1's C++ interpreter, and the details follow the programs it runs.

The machine

Mario starts at the top left, walking right. Each tick he does what he stands on, then falls one row if there is no ground below him, else takes one step.

CharDoes
= \|Ground and wall
# "An elevator and its end. Standing still on # he rides up or down to the " in that column
) (Move the memory pointer
+ -Add or take one
. :Print the cell as a byte, or as a number and a space
, ;Read a byte (-1 at the end) or a number
> < @Walk right, walk left, turn around
^Jump one row up
!Stop walking
[Skip the next command he meets if the cell is 0

The run ends when Mario falls off the bottom of the level or stands still on plain ground.

Example

Count up to 81 and print it as a byte, on one flat floor.

Count up to 81 and print it as a byte, on one flat floor.

A cat. ,+[ reads a byte and adds one, so the end of input (-1) becomes 0 and [ skips the <. Otherwise Mario turns back, takes the one away, prints the byte, stops on the elevator and rides up to start again.

Expected: hello

A truth machine. ; reads a number and : prints it. A 1 makes [ let the < through, and Mario runs back and forth over the : forever; a 0 skips it and he stops at !.

Expected: 0

Patterns it teaches

Further

Two-dimensional languages

Cell-based

Write your own in Run Convert a program from MarioLANG

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: mariolang.

Command line

shib run mariolang -e '>;>:[<!
=======' --input '0'
shib manual mariolang

Source

Module
langs/tio/ports.js
Interpreter
langs/tio/mariolang.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org