Andromeda is a two-dimensional, queue-based programming language in which, apart from the usual direction-changing arrows (which also serve additional purposes), there is only one additional command. The language was created and implemented in 2018 by User:ZM.
Andromeda is a two-dimensional language. It uses a square grid whose top and bottom (but not left or right) are joined together.
The language has five commands: the directional arrows
><^v, which are used for changing the direction of the instruction pointer and pushing items onto the queue, and the question mark
?, which pulls items from the queue and can be used for control flow. Any characters other than the five mentioned are ignored.
The instruction pointer starts at the top left edge of the grid, moving right. Program execution ends when the instruction pointer exits the left or right edge of the grid.
The directional arrows serve two purposes:
- When the instruction pointer hits an arrow which points neither in the same direction or the opposite direction as the instruction pointer, it turns to face the same way as the arrow.
- If, however, the arrow points the same direction as the instruction pointer, it pushes a 1 onto the queue.
- If the arrow instead points in the opposite direction as the instruction pointer, a 0 is pushed onto the queue.
? pulls the oldest item from the queue. If it is a 1, the instruction pointer is rotated counterclockwise; if it is a 0, the instruction pointer is rotated clockwise.
Andromeda is Turing-complete; the easiest way is probably via cyclic tag, which can be easily translated into Andromeda using the following structure:
(initialization)v>(ones and zeroes translated into > and <)v> v >? >? ... >v > ^> ^ ^ <
This is an interpreter written in Python which doubles as a simple Andromeda program. This interpreter prints the contents of the queue before every
import sys#>>>>v # ?? file = open(sys.argv, "r") field = file.read().split("\n") file.close() field_size = [len(field), len(max(field, key = len))] for i, item in enumerate(field): field[i] = item.ljust(field_size) #print("\n".join(field)) instr_pointer = [0, 0] pointer_speed = [0, 1] queueue =  while instr_pointer in range(field_size): instr_pointer = [instr_pointer[i] % field_size[i] for i in (0, 1)] command = field[instr_pointer][instr_pointer] if command in "<>^v": if pointer_speed == [[0, -1], [0, 1], [-1, 0], [1, 0]]["<>^v".index(command)]: queueue.insert(0, 1) elif pointer_speed == [[0, 1], [0, -1], [1, 0], [-1, 0]]["<>^v".index(command)]: queueue.insert(0, 0) else: pointer_speed = [[0, -1], [0, 1], [-1, 0], [1, 0]]["<>^v".index(command)] elif command == "?": print(queueue) if len(queueue) and queueue[-1]: pointer_speed = [-pointer_speed, pointer_speed] else: pointer_speed = [pointer_speed, -pointer_speed] if len(queueue): del queueue[-1] instr_pointer = [instr_pointer[i] + pointer_speed[i] for i in (0, 1)]