User:ZippyMagician/Ideas

From Esolang
Jump to navigation Jump to search

What follows are a bunch of ideas I have yet to develop, have lost the documentation for, or are simply not "good enough" for them to warrant their own page on the website

I have lost all documentation for this, all that is left is a note that says "This is probably turing complete". Here are some of the programs for it:

Hello World

"Hello, World!">#

Truth Machine

$>{∞>{1.>#}}0.>#

Cat Program

∞>{($>#)>|}

Fibonacci Sequence

2<"\n"0.>1.>0{(0+1)>0>#2>@(0+1)>1>#2>@}<∞

Factorial Calculator

1.>0.>1$>{0<(0*((1+1.)>1))}0>#

Dots

Input as char or int. Output as char or int. Commands in form <arg1>op<arg2>, changes depending on args required. Can separate with newlines and spaces if needed.

Syntax

. -> Store arg1 into mem[arg2]
, -> Retrieve mem[arg2]
.. -> Print arg2 as char
,. -> Print arg2 as int
., -> Goto command arg2 if arg1 == 0
,, -> Read STDIN and place into mem[arg2]
,.. -> Perform arg1 + arg2
... -> Perform arg1 - arg2

Programs

Truth Machine

,,0,0.,5,.1
0.,3,.0

Cat Program

,,0,0,..1.,6.. ,0
0.,0


Prisoner

Pretty self explanatory. Inmates are released with RELEASE INMATE ID. The ID is a 6 digit alpha-numeric identifier preceded with a #. You cannot have two prisoners with the same tag. Provide no tag if you want to represent the prisoner accepted in ON NEW INMATE DO blocks (or any similar do blocks). ACCEPT INMATES UNTIL will automatically assign each prisoner a tag, from lowest possible to highest possible (skipping all predefined prisoners) if necessary. UNLESS can come after any function to act as an "if false" statement. Math will be possible, just not implemented yet.

Hello World

ACCEPT INMATE #000001
INMATE #000001 IS "Hello, World!"
CALL FOR INMATE #000001

Cat Program

MAX CAPACITY IS LENGTH OF STDIN
ON NEW INMATE DO
   INMATE IS READ
   CALL FOR INMATE
END
ACCEPT INMATES UNTIL FULL
ACCEPT INMATE #000001
INMATE #000001 IS STDIN
CALL FOR INMATE #000001

Truth Machine

ACCEPT INMATE #000001
INMATE #000001 IS READ
CALL FOR INMATE #000001
CLOSE PRISON UNLESS INMATE #000001 IS 1
MAX CAPACITY IS INFINITY
ON NEW INMATE DO
   CALL FOR INMATE #000001
END
ACCEPT INMATES UNTIL FULL

Undefined

A language where the syntax starts undefined, and you must assign letters that are valid in the program between <...>. Afterwards, each letter is given a function based on its index or something similar. Extra letters are considered variables, initialized at 0

Hello World

<HelloWorld ,!t][rg"sap>"Hello, World!"p

Truth Machine

<7Xt][rg"sap>rX[Xpt]Xp"7"g

Atom

Description

Define atoms with Name :: value; OR Name :: { arg(s), func };. Atom names must follow element names, which means they must either be one or two alphabetical characters, with the first capitalized and the second not. Run by connecting atoms with pipes (-|/\) inside parenthesis outside a {} block. Args aren't required, so if you want to re-evaluate an atom every time you parse it, just put curly brackets around the value. Arguments are passed to an atom with : Built-ins are:

i = stdin stream, separated by lines. If you want to read the next char in the second line, use i:1. If you don't care if you use all of the lines, just provide i.
o = out stream
m:n Store piped value into memory[n]
-> = Pipe arg to stream or memory

Syntax for functions is:

... <; item = Do ... if item. Can include ;> .. to do: Do ... if item else do ..
... <: item = Do ... while item.
& = Terminate program
+ - / * = Mathematical operations (e.g. O :: { x, 4 + 3 -> m:x } creates atom O that stores 7 into mem[x])

Strings denoted with quotation marks, numbers as numbers. All atoms can pass their final evaluated value onto the next Atom when in a chain.

If multiple while/if statements are in a row, they are evaluated back to front.

Molecule Construction

In order for a program to actually execute, you must construct a molecule inside parenthesis. This is an important feature in the language, as piping atoms into new atoms can transmit the return values as arguments in a the next. Here's how that works:

A-B --> Atom A is evaluated, and given to B as an argument
A
| --> Atom B is evaluated, and given to A as an argument
B

When two arguments are provided, the one coming from the left is referred to as X and the one coming from below is Y. If a looping atom is attached as an argument to another atom, for every loop the value will be given to the attached atom. To mark the starting atom the molecule is evaluated from, put a ^ before the atom name.

Programs

Truth Machine

R :: i;
T :: { x, x -> o };
L :: { x, T:1 <: x };
(
  T
  |
  ^R-L
)

Cat Program

I :: { i -> m:0 };
L :: { m:0 -> o <: I };
(^L)

brainfuck interpreter?

Since I have not built an interpreter, it is impossible to truly test what computational class this language is. However, what follows is what I believe to be a valid brainfuck interpreter in the language, which would indicate this language to be Turing complete:

R :: { i:0 -> m:1 };
I :: { 4 -> m:0 4 -> m:2 };
F :: { m:0 + 3 -> m:0 m:0 - 2 -> m:3 };
Li :: { m:1 -> m:m:0) m:0 + 1 -> m:0 <: R };
Lp :: { m:2 + 1 -> m:2 m:m:2 - 1) <: m:m:2 };
P :: { x, Br <; x - 91 ;> Bl <; x - 44 ;> Ec <; x - 46 ;> Ed <; x - 45 ;> Em <; x - 42 ;> Ep};
Ep :: { m:m:0 + 1 -> m:m:0 };
Em :: { m:m:0 - 1 -> m:m:0 };
Ed :: { m:m:0 -> o };
Ec :: { i:1 -> m:m:0 };
Bl :: { m:2 -> m:3 };
Br :: { m:3 -> m:2 <; m:m:0 };
(
  F-Lp-P
  |
  ^I-Li
)

D.P.L. (Dimensional Programming Language)

Syntax

Dimensions are defined by the size of the program if n is # of program commands, dimensions = floor log2(n), and length of each dimension = n Lets say your program is of length 4. This will result in a 2 dimensional program, with each dimension of length 4. This means 8 items can be stored in memory (4 per dimension) and 8 commands can be run (4 per dimension). Programs are one line A pointer called N refers the the current spot in the dimension. If you start heading left in dimension 2, N will start decrementing on every command instead of incrementing. The alternate is true for heading right. Essentially, you can think of > as saying the following program goes right, while < says the opposite (while the source code always appears to be heading right)


The program also stores a single unsigned 8-bit integer called "X"

Syntax:

^ -> Go up a dimension (terminates program if no dimension to go up to)
v -> Go down a dimension (terminates program if no dimension to go down to)
< -> Start moving left through the dimension
> -> Start moving right through the dimension
# -> Store X into current slot of dimension
@ -> Retrieve X from current slot of the lower dimension
~ -> If X != 0 then goto the next movement command
! -> Print X (ascii or int determined by interpreter)
& -> Move STDIN into X
+/- -> Increment/decrement X by 1
: -> Halt

Programs

Truth Machine

&~!:^>!<

Cat Program

>&#~:^<<<@!v

For loop

Decompressed

         >>>>>>>v
         ^:~-@<<v
>>>++++++++++#v^>>>>@!>>v
^v<<<<<<<<<<<<<^<<<<#+@<v
^>--------->>>>>>>>>>>#^v
^                    ^<<<

Compressed

^^^>>>++++++++++#v<<<<<<<<<<<<<v>--------->>>>>>>>>>>#^<@+#<<<<^^<<@-~:^>>>>>>>vv>>>>@!>>vvv<<<^

Rubix

Based around a rubix cube. You start by declaring the initial state of the cube like so (integers can be 0 or 1)

000
000 -> One face of the cube, represented as 000000000. Each face separated by commas. Faces go in order 1,2,3,4,5,6, where 1 is the starting face, 2 is a turn to the right, ..., 5 is up from 
000    the start, and 6 is down from the start. Binary is outputted left to right, top to bottom.

The next bit of the program modifies the cube to run something.

Syntax

o -> Output the current face as a binary 9-bit integer
L -> Rotate rubix cube to the right
l -> Rotate rubix cube to the left
D -> Rotate rubix cube up
d -> Rotate rubix cube down
s -> Rotate current face to right
S -> Rotate current face to left
r1 -> Rotate row 1 right
R1 -> Rotate row 1 left
c1 -> Rotate col 1 up
C1 -> Rotate col 1 down

Programs

Hello World (Only prints Hello)

001001000,001100101,001101100,001101111,000000000,000000000
oLoLooLo

Ideas

  • Some language that runs its source code in a circle-like structure? Loops around infinitely
  • A language where everything is performed on arrays?
  • A totally original 2D language
  • A golfing language (not one with single character commands though).