ArrayFuck

From Esolang
Jump to navigation Jump to search
ArrayFuck
Paradigm(s) Imperative paradigm
Designed by User:MinekPo1
Appeared in 2022
Memory system cellbased
Dimensions one-dimensional
Computational class Finite-state automata
Reference implementation ArrayFuck
File extension(s) .af

ArrayFuck is a essoteric programing language based on a array

Overview

The base of ArrayFuck is a array of integers on indexes from -32768 to 32767. By default, the array is initialized with the value 1. Each index can store values from -32768 to 32767. An ArrayFuck program is made up from one assignment.

There are two possible ways to access the array:

- [-]: access the element at the index 0. - [<expr>]: access the element at the index of the expression.

An expression can be either a access to an array or an assignment to an array.

To assign a value to an array, you can use the following syntax:

   [<expr>] = <expr>

Alternatively, you can use the following syntax:

    [<expr>] - <expr>

Which will subtract the value of the expression from the element at the index of the expression.

If an assignment is used as an expression, the value of the expression will be returned.

If the square brackets are left empty, it will be used as ASCII io.

Loops

To make a loop, the colon is used.

    <expr>:<assign>

The assignment will be executed until the expression is zero. If used as an expression, the last value assigned will be returned, unless

Comments

All characters except for [, ], `=, - and : are ignored.

Examples

Cat machine:

   [[-]:[] = []] = [-]