Arrows

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Arrows is an unfinished esoteric programming language by User:SoundOfScripting (readers may also contribute, current contributors: User:Joaozin003) that only uses UTF8/Unicode arrows.

A list of accepted arrows can be found here.

Syntax

Format

Programs written in Arrows consist of two-dimensional grids of Unicode characters. Any characters that are not recognized are treated as comments.

Threads

An Arrows program's flow consists of multiple "threads" of binary data that follow the course of arrows throughout the grid. Each thread can hold a different amount of bits, usually corresponding to the number of arrows in a single character (i.e. holds one bit and holds two).

Thread movement

Unless a thread is depending on another one, threads move one arrow at a time simultaneously. In the splitting example above, whichever thread that attempts to merge first must wait for the other one to catch up before merging into two bits.

Threads may also point towards themselves, allowing for infinite loops.

Threads moving into comments or thread sources will immediately be destroyed.

Commands/arrows

  • , , , , , , , and transfer a one bit thread of data from the base of the arrow to the tip.
  • and invert the value of the bit(s) they transfer (these arrows transfer any-sized threads).
  • and create new one bit threads (0 and 1 respectively), which transfer to any thread-continuing arrows (arrows that use one or more threads as inputs) next to the or .
  • , , , , , , , and transfer two bits threads from the base of the arrow to the tip.
  • and split bigger threads into smaller ones and may duplicate threads into same sized parts (they work in the opposite direction they are named).
  • and direct threads to their respective tips combined with a random direction from this list:
    • Up
    • Down
  • splits threads, and each part goes to one tip and combined with a random direction from the list above.
  • and direct threads left and down respectively if the first bit of a thread is 0, otherwise they're directed right and up respectively.
  • outputs a thread and destroys it.
  • gets a bit from input and creates a thread with it it (similar to and ).

Example programs

Splitting and merging

A n y t
e x t
c a n
g o
h e r e .

This example outputs the binary string "01". It is definitely not the most efficient way to do so.

Output infinite 1s

This program works by duplicating a one bit stream, outputting it, and repeating (the next duplication gets done after the output since threads don't move instantly).

Thread creation failure

This program outputs the first four bits from the input stream (in any order).

Truth machine

1
0

This program takes 1 bit of input, and if it is 0, it outputs 0, else it outputs infinite 1s.

External resources