esolang

Mineso

A tape where the first cells are the operators, and every number is written in 1s.

DeadlyFugu, 2011 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: 543210

The idea

DeadlyFugu made Mineso in 2011. It has a tape of cells and a pointer, as brainfuck does, but there is no add or print command. Instead some cells act on any value sent to them. Send 5 to cell 1 and it adds 5 to itself; send 72 to cell 6 and it prints H. The specification says this lets an implementation add new operations or I/O as new cells, without new commands.

Read the story

The only digit is 1. Each command takes the number of 1s that follow it, so >111111 sends to cell 6. Every other character is ignored, which leaves room for comments.

The machine

CommandDoes
-nPoint at cell n
<nSend n to the cell
>nSend the cell's value to cell n
=nSet the cell to n, without its rule
@nCopy cell n into the cell, without its rule
?nSet the cell to 1 or 0 by test n against cell 5; 0 equal, 1 less, 2 greater, 3 not
[n ]nIf the cell is not 0, jump n+1 commands forward or back
CellA value sent here
0Goes to that command; the cell holds the command being run
1 2 3 4Is added, subtracted, multiplied or divided into it
6Is printed as a character
9 10Shifts it left or right by that much
11Is printed as a number

The reference interpreter has 256 cells of 8 bits, and so does this implementation. The specification leaves the start of the pointer open; it is cell 0.

Example

The count down sets cell 2 to 6, subtracts 1 by sending it there and sends the result to cell 11 to print it.

The count down sets cell 2 to 6, subtracts 1 by sending it there and sends the result to cell 11 to print it. ]1 jumps back two commands while cell 2 is not 0.

The powers of two keep a counter in cell 2 and a value in cell 9. Sending 1 to cell 9 shifts the value left by one.

Expected: 1248163264128

Hello World adds to cell 1 and sends it to cell 6 for each letter. It ends up at r in cell 6 and pulls that back with @111111 to reach l and d.

Expected: Hello World!

Patterns it teaches

Further

Cell-based

Write your own in Run Convert a program from Mineso

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: mineso.

Command line

shib run mineso -e '-11=111111<1>11111111111]1'
shib manual mineso

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/mineso.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org