Patterns

From Esolang
Jump to navigation Jump to search

Patterns is a programming language that makes patterns

A pattern

P1:a1
P is the letter made
1 is the name
: is the separator
a1 is generated after P is generated, note: if one of the letters in the generator part is a pattern, it will be replaced, so a1 will be aa1 will be aaa1...

The start pattern

S_:1
S is the letter made
_ is the start pattern piece
: is the separator
1 is a non existent pattern, so it will make the number 1

A pattern that generates nothing but the generator part

_1:example
_ is the no letter maker piece
1 is the name
: is the separator
example is the text generated

The halt pattern

_A:.
A is an instant halt pattern
every time a . is generated by itself, the program halts

The input pattern

__:*+*0
_0:.
the * when generated is replaced by an amount of characters chosen by the program user, you can use multiple *
if the first * is replaced by 1 and the second * is replaced by 2, the output is 1+2., the . is used to halt the program

An example

__:1nnnnnnno
_1o:. ~halts and replaced with .
_1n:a1
output is aaaaaaa.

A transition

to transition from slashes to patterns, do this:
replace the /a/b/ with _a:b
replace the input as a to the program with __:a
new thing that is different from slashes: use * to make dynamic input instead of static input, because the other way is hardcoded