MIG+

From Esolang
Jump to navigation Jump to search

MIG+ is a version of MIG with a shared variable (starts at 1 by default)

Instead of going to the next command in the stack, they go to a command based on the variable and set the variable to a different value.

Notation:

MIG+ code looks like this:

x_{1,1},y_{1,1},"string_{1,1}":z_{1,1,1},z_{2,1,1},z_{3,1,1},...,z_{w_{1,1},1,1}|x_{2,1},y_{2,1},"string_{2,1}":...|...|x_{n_1,1},...
x_{1,2},...
.
.
.
x_{1,m},...

x_{a,b} is the line the code will go to after this command, y_{a,b} is the value the variable will take after this command (optional, without y_{a,b} the value doesn't change), output "string_{a,b}" (if this is inculded), then the next command that will be executed is at place z_{c,a,b} in the line where c is the varible

for user output, @; can be added to the front of the segment x_{a,b},y_{a,b},"string_{a,b}":z_{1,a,b},z_{2,a,b},...,z_{w_{a,b},a,b} this means the segment uses a number of the user's choice rather than the variable. That or y_{a,b} can be replaced by # which set the variable to the user's choice

(note: replacing the segment with nothing or a string means the program will simply terminate when it is run (if a string is included it will output said string))

Programs

Hello world

1,1,"Hello world":1

Cat program(limited)

@;1:2,3|1,1,"1":1|1,1,"2":1

Truth Machine(0->1;1->2)

@;1:2,3|"0"|1,1,"1":3