Mineso

From Esolang
Jump to: navigation, search

Mineso is a turing-complete[citation needed] I can convert some BF to Mineso, but I don't know enough BF to convert anything] programming language made by DeadlyFugu. It uses tape memory, which starts at position 0 and, if on a Turing machine, could go on for infinity. However, it'd be impracticle since Mineso uses unary, with the only number it has being '1'. Every operation in Mineso requires a number after it, having no 1's after it would be treated as a zero.

Language overview

Like BF, Mineso uses an array of memory cells, with a each set to zero by default and a pointer. You are expected to set the pointer on program start, so what the pointer is by default is up to the implementation.

Certain memory cells don't act as you would expect in BF. Cells 0,1,2,3,4,6,9,10,11 will all do something other then just store a value.

Assuming n is the value you are sending to the cell,

Cell Description
0 Goto the nth command in. This cell will always be the value of the current instruction (Hence, an implementation can't have more cells then the maximum a cell can go)
1 Add n to the existing value, and store in cell.
2 Subtract n from the existing value, and store in cell.
3 Multiply n by the existing value, and store in cell.
4 Divide the existing value by n, and store in cell.
6 Prints sent value using ASCII to stdout (It is not followed by a newline), and store in cell.
9 Bit-shift left, then store in cell
10 Bit-shift right, then store in cell
11 Prints sent value as a number to stdout, and store in cell.

The advantages of working this way is that one can easily add in a new mathematical operation or something, without the need to add in more commands. It also allows implementations to add in support for all sorts of crazy I/O, library access and whatnot, without the need to fork the language and add in new commands.

The value in the active cell can be modified and moved around using commands. Every command requires a unary number after it (With no 1's after it meaning a 0).

Assuming n is the tailing number:

Command Description
- Set the pointer to the cell n.
< Put n into the active cell, adhering with the cell's 'rules'.
> Put the active cells value into cell n, adhering with the cell's 'rules'.
= Set the cell to n, ignoring the cell's 'rules'.
? Set the cell to 1 or 0, depending on the result of a logical operation with the active cell and the 5th cell. n is the operation. 0 is 'Is the same as' (Or '=='), 1 is 'Less than' (Or '<'), 2 is 'More than' (Or '>'), 3 is 'Invert' (Or '!'). 3 doesn't care about the data in cell 5, it just inverts the active cells data (So ?1?111 is 'More than or equals', ?11?111 is 'Less than or equals')
[ If the active cell's value is non-zero, jump forwards n+1 commands.
] If the active cell's value is non-zero, jump backwards n+1 commands.
@ Pull the value from position n into the active cell, ignoring the cell's 'rules'.

Any symbols that are not in the above list or a 1 are ignored (So '<C a,1R' is equivalent to '<1').

Examples

Hello, World!

This should print 'Hello World!' to the screen (Without a newline)

-1 <111111111111111111111111111111111111111111111111111111111111111111111111 >111111 <11111111111111111111111111111 >111111 <1111111 >111111 >111111 <111 >111111 =11111111111111111111111111111111 >111111 <1111111111111111111111111111111111111111111111111111111 >111111 <111111111111111111111111 >111111 <111 >111111 >11 -11 <111111 >111111 <11111111 >111111 =111111111111111111111111111111111 >111111

To the power of

Replace A with a unary number, and B with a unary number. It then prints A to the power of B.

-1111111=A-11=B-1=@1111111>111=1>11=@11]11111111@111>11111111111

Counts down

']' is very useful for loops, this is a good example.

-11=111111<1>11111111111]1

External resources

Implementations

Mineso interpreter by DeadlyFugu. The interpreter uses 8-bit cells with 256 cells in total. One could easily rewrite the source code (It's GPL'd) to have bigger/more cells. Also, the Window's .exe's are outdated, and the debug info probably doesn't make any sense to anyone other then him. Then again, it is an esoteric programming language, no?