SHAat

From Esolang
Jump to navigation Jump to search

SHAat stands for Secure Hash Algorithm automata, and is pronounced shat. SHAat stores information as a doubly infinite two dimensional array of Boolean values. At the start of a SHAat all of the values are set to 0. SHAat commands can be split up into three types. The first type is read and write commands. Any data location can be set to 1, 0, or user's input using square brackets and a standard = expression and the key word input. Some examples of this are:

[0,0] = 1
[-1,2] = 0
[10,100] = input

Note you are not able to use a value saved at one location to set a value save at another relocation.

The next type of commands are the out commands. These are written with the key word out then a type and finally an ordered list of locations that make up a binary string. An example of this might be:

Out bool {[0,0]}
Out char {[0,0],[0,1],[5,7],[6,10],[21,21],[-1,-1],[,5,5],[0,0]}

The out command prints directly out and can not be used to effect the running program.

The final command is SHAat which gives the language its name. SHAat can either take an integer or a string which it will convert to an integer. After this SHA-512 is run on its input. This will return a 512 bit sequence. This sequence is then used to define a rule set for a fundamental two dimensional cellular automaton. These rules are then followed for a single step over the whole grid.

Fundamental two dimensional cellular automata

A fundamental two dimensional cellular automaton is a two dimensional cellular automaton where the value of each cell during the next iteration only depends on its current value and the value of its 8 surrounding cells. These cells form a 3 by 3 square that can take on 512 different states. Each of these states can be given a number x. For example x is 0 when all 9 of the cells are 0, x is one when only the top left cell is 1, and so on. From here every rule set can be described with a 512 bit number where the xth bit is 1 if a cell in the center of and x state 3 by 3 square will become 1 and the xth bit is 0 if it will become 0.