axo
A Befunge relative whose strings still obey the arrows, so a message can turn a corner in the middle of a word.
Jannis Harder, 2004 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 4 known programs · Hello World on Try It Online: identical · Test method
Run it
The idea
Jannis Harder made axo in 2004, inspired by Befunge. The name is said like the German "ach so". It has a grid, a stack, two registers and 2048 memory cells, and three modes. In command mode every character is an instruction. In string mode characters are pushed, but arrows, arithmetic and \ still work, so a string can bend round the grid. Raw mode pushes everything.
The machine
The IP starts at the top left moving right and wraps at the edges. Popping an empty stack gives 0.
| Char | Does |
|---|---|
^ < > % | Turn up, left, right, down (in every mode but raw) |
0-9 | Push a digit |
+ - * / | Arithmetic; / pushes the quotient and the remainder |
" ' | String mode, raw mode |
\ | Stop |
[ ] & \| | Dup, drop, rotate the stack one way or the other |
# $ ! ? _ | Skip if 0, turn by a value, turn clockwise, turn at random, go home |
( ) { } | Write and read a byte, write and read a number |
: . ; , | Store into register a or b, push it back |
= @ | Swap a value with a memory cell, empty the stack |
Example
Push three letters and print them.
Push three letters and print them.
The Hello World from Try It Online. The string turns down at % and left at < without leaving string mode, so Hell is read backwards on the second row. Then [# loops: duplicate, and if it is not 0 go down through >( to print it and back up through ^. The 0 under the stack ends it at \.
Patterns it teaches
- Two-dimensional control flow: arrows act inside strings, so text and flow share the grid.
- Stack machines: a stack, two registers and a small memory.
Further
See also
Queue-based
Two-dimensional languages
Write your own in Run Convert a program from axo
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: axo.
Command line
shib run axo -e '98*(\'shib manual axoSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/axo.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org