Trail
Text written in binary with the arrow keys. A left arrow and a right arrow must never touch.
Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Trail is meant to be typed on a grid with the arrow keys and the space bar, which leaves a trail of arrows. The trail is read as binary. > and < are bits, ) ends a character and ˇ, the down arrow, does nothing. Its one rule is that > and < must not collide, which the specification says is there to make it more challenging. A ˇ between them keeps them apart. Its JavaScript implementation is 452 bytes.
Read the story
The specification's prose has < as 1 and > as 0. Its three examples print what their titles say only the other way round, so this implementation reads > as 1.
The machine
| Char | Does |
|---|---|
> < | A 1 bit, a 0 bit |
) | Print the character whose code the bits since the last ) spell |
ˇ | Nothing, but it keeps arrows apart |
Line breaks are removed first. A > right beside a < is an error. The bits after the last ) make one more character.
Example
The first spells 110110 and 111001, the codes of 6 and 9.
The first spells 110110 and 111001, the codes of 6 and 9. The second spells 110001, the code of 1. The Hello, World program takes 23 lines and ends with a ! that its title leaves out.
esolangs.org files Trail under Turing complete. A program has no input and no jumps, so it can only print the text it spells.
Patterns it teaches
- Encoding tricks: text as bits, drawn as arrows.
Further
See also
Also in Turing tarpits
Write your own in Run Convert a program from Trail
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: trail.
Command line
shib run trail -e '> > ˇ
< < <
ˇ >'shib manual trailSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/trail.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org