1L_a
Two symbols: a space, and everything else. The spaces do the work and the rest are walls.
Scott Feeney, 2005 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 1 known program · Hello World on Try It Online: identical · Test method
Run it
The idea
Scott Feeney designed 1L_a in 2005, the first of the 1L family to be implemented. The 1L proposals try to shrink 2L from three symbols to two. In 1L_a the space is the only command and any other character is a wall. The 1L_a105 standard goes one step further: whatever symbol sits in the top left corner is the command, so a program can even be a picture with a coloured path.
Read the story
The tape holds bits. Output is memory-mapped and comes out one bit at a time, eight to a byte, so a single letter is a maze of a few hundred cells.
The machine
A grid, an IP starting at the top left moving down, and a tape of bits with the data pointer on bit 2.
| The IP meets | Does |
|---|---|
| A space, moving left | Move the data pointer left and flip that bit |
| A space, moving up | Move the data pointer right |
| A space, moving down or right | Nothing |
| A wall | Turn left if the bit is 0, right if it is 1, before entering it |
Flipping bit 0 does I/O. With bit 1 set it writes bit 2 as the next output bit, most significant first; with bit 1 clear it reads an input bit into bit 2. The run ends when the IP leaves the grid.
Example
Try It Online's program, which prints A.
Try It Online's program, which prints A. Every x is a wall and the spaces are the path. Each climb moves the data pointer up the tape, and each run to the left flips bits on the way back down; reaching bit 0 writes the next bit of the letter.
Patterns it teaches
- Turing tarpit: one command, and its meaning comes from the direction.
- Two-dimensional control flow: a wall is the only branch.
- Encoding tricks: I/O is three bits at the start of the tape.
Further
See also
Non-textual
Two-dimensional languages
Write your own in Run Convert a program from 1L_a
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 1l-a.
Command line
shib run 1l-a program.txtThe program is long; save it as program.txt first.
shib manual 1l-aSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/1l-a.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org