Alphaton

From Esolang
Jump to navigation Jump to search

Alphaton was originally a brainfuck clone, but soon became its own thing. Unlike most languages, which has punctuation, Alphaton does not use any and are skipped when running commands along with any non-functioning letters which do not have a command linked to them. Alphaton is also case-sensitive.

Alphaton
Designed by User:ColonelMatthew97
Appeared in 2022
Computational class Total
Reference implementation #Resource
File extension(s) .txt/.alpton (theroetical)

Input

Main input is separated into two. The MCL (Main Command Line) and the LCL (Loop Command Line). You can only write in the LCL if your code reaches an O command and the current cell value is NOT 0.


There is also input for more commands.


The r function. A Min and Max for a random integer to be chose from. E.g.MCL: r, Min: 1, Max: 10 | Output - Data Integer Tape: [9, 0, 0, ...], Current Data Integer: 1.


c allows you to define the amount of memory you want. E.g.MCL: c, Amount of cells: 3 | Output - Data integer Tape: [0, 0, 0, 0, 0] to [0, 0, 0]

Commands

The commands are as follows:


A: Adds 1 to current integer.

S: Subtracts 1 from current integer.

M: Multiplies current integer by saved integer.

D: Floor divides current integer by saved integer.

m: Advanced math functions.

r: Asks for 2 integers. A random integer from the provided range will replace the current integer value.

L: Move to the next integer to the left.

R: Move to the next integer to the right.

P: Prints corrosponding letter of alphabet.

p: Prints and appends current integer value.

I: Asks for a number. Number will replace current integer value.

i: Asks for a number. Number will be the selected value on tape.

E: Resets current integer to 0.

s: Saves current number to memory.

l: Loads saved number to current position, replacing the previous.

e: Clear saved string.

Z: Transfers current value to the left.

X: Transfers current value to the right.

c: Asks for a integer. Integer will be the no. of cells avaliable for memory.

d Asks for a float. Float will be time between instructions.

O: Opens loop if value of integer IS NOT 0.

C: Closes loop if value of integer IS 0.

(Loops are NOT stackable)

Examples

MCL: AAARSS will add 3 to cell 1, and subtract 2 from cell 2.


MCL:ARARARALLLO | LCL: RC will set cells 1-4 as non-zero, point at cell 1, then demonstrates the loop function by moving the cell pointer to the right until the cell it is on has a value of 0.


MCL: AAAAAAAAAA AAAAAAAAAA AAAAAA|AAAAAAAAP|E|AAAAAP|AAAAAAAPP|AAAP|R|AAAAAAAAAA AAAAAAAAAA AAAAAA|AAAAAAAAAA AAAAAAAAAA AAAAAA|AP|E|AAAAAAAAAA AAAAAAAAAA AAAAAA|AAAAAAAAAA AAAAAAAAAA AAAP|E|AAAAAAAAAA AAAAAP|AAAP|SSSSSSP|SSSSSSSSP|R|AAAAAAAAAA AAAAAAAAAA AAAAAA|AAAAAAAAAA AAAAAAAAAA AAAAAA|AAAP is the classic "Hello World!" program.

Notes

  1. A cell amount limit does not exist, but you only have 15 cells as default.
  2. The LCL must have a C at the end or the loop will not work as intended.
  3. Spaces are ignored by the interpreter below. You can separate chunks of work with them.
  4. It is recommended to store a larger program externally as Alphaton is written in portions, not all together. Especially if you need to use loops.
  5. Comments are virtually impossible due to the nature of the language.
  6. You don't need to waste memory. Since Alphaton 0.5, you can now tell the interpreter how many cells you want.

Updates (v0.7+)

v0.7 - 12/Nov/2022

  1. The interpreter does no longer fill the terminal with all of the cells, 5 cells is shown instead.
  2. New delay command: d{float}

v0.8 - 13/Nov/2022

  1. New string value (only one)
  2. P and e commands are different, with the latter being reworked entirely (clears string, not saved value). P Now also adds the character to the string (left to right) like adding to a stack.
  3. The pointer value has been removed with a more subtle way of showing the selected cell. I.e. [0,0,>0<,0,0] and Cell No.: -1,0,>1<,2,3.
  4. Up to 75 printable characters (previously 62).

v0.8.1 - 15/Nov/2022

  1. p now adds the value of the data integer into the string. This might allow some possible calculators and other things to be made. Remember the space!

Resource

If you want a Python implementation, simply click the link for the interpreter. https://github.com/SirWobb79/Alphaton