User:Yayimhere/Pseudo
Pseudo is an esoteric programming language created by User:Yayimhere, to create a language that simulates a 2d environment while it technically isn't. This fake environment holds both numbers and parts of the program.
Memory
Memory is stored in a potentially infinite number of unbounded numeric counters. One of those is the main counter, which has no numeric label, while the set of "memory counters" have numeric labels. Each memory counter, and the main counter, is initialized as follows:
M: MainCounterValue #1: Counter1Val #2: Counter2Val #3: Counter3Val ...
and so on up until the last counter. additionally there is a pointer counter and a number of program counters, which both hold a numeric value(which is decremented every iteration). The pointer counter is define as follows:
start [value]
and the program counters are defined as:
"1: [s1, -m1] "2: [s2, -m2] "3: [s3, -m3] ...
and so on up until the last program counter. the counter value of program counter n will be equal to the pointer counter minus its value m(initially). this replaces m for the rest of execution. Every iteration each numeric half is decremented, after the commands have been performed. One program counter must have an m value of zero. There's a number of sets of counters each assigned its own letter, which are syntactical elements:
A: The set of memory counters.B: The set of program counters numeric half.C: The set holding only the pointer counter.
The sections defining memory are to be listed in the program in the order given. Note that all counters are signed integers:
0x (positive) 1x (negative)
Semantics
One iteration starts by checking each program counter if it is equal to the pointer counter, going from the one labeled with "1, then "2, ect.. Whenever they are equal, the string part is executed. This goes on, until no program counters are equal to the pointer counter. Each time this check happens is a single iteration.
Executing
the following commands take in a set, and then perform an action.
{^}{set} |
Increments everything in set thats equal to the main counter by 1.
|
{v}{set} |
Decrements everything in set thats equal to the main counter by 1.
|
{/}{set} |
Increments everything in set thats equal to the main counter by the given counters own labeling value, decremented by one(the label value).
|
{\}{set} |
Decrements everything in set thats equal to the main counter by the given counters own labeling value, decremented by one(the label value).
|
{=}{set1}{set2} |
Sets each numeric label of set1 to the corresponding one in set2.
|
{-} |
Decrements the main counter by 1. |
{+} |
Increments the main counter by 1. |
these are separated by spaces.
Set notation
The set notation is quite simple, made up of the three sets from before(A,B,C), as well with the empty set(Ø), and x c y which is the union of set x and set y.