3 pentits, 25 pentytes
A base-5 computer with 25 cells. The program is 25 characters, and those characters are the memory.
Mutasimos, 2026 · Turing complete: no · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Mutasimos made this in July 2026, after 2 Bits, 1 Byte and 2 trits, 3 trytes. A pentit is a base-5 digit and a pentyte is three of them, so a cell holds 0 to 124. The specification maps 125 ASCII characters onto those values, lower case a to y being 100 to 144 in base 5. A program is the 25 cells written as characters. Code and data share the memory, so a program prints its own text by pointing at it.
The machine
The low two digits of a cell are its opcode, or an address from 0 to 24. A value argument uses the whole cell. The pointer wraps after cell 24.
| Opcode | Name | Does |
|---|---|---|
00 | DON | Nothing |
01 02 03 04 | PRT INC DEC FLP addr | Print a cell as its character, add 1, subtract 1, turn each digit d into 4 − d |
10 | JMP addr | Jump |
11 12 | JIZ JNZ then addr | Jump if the cell is 0, or is not |
13 14 20 21 | ADD SUB MUL DIV addr val | Arithmetic modulo 125 |
22 23 24 | JLT JGT JEQ then addr val | Jump if the cell is below, above or equal to val |
44 | END | Stop |
The specification leaves opcodes 30 to 43 undefined; in this implementation they do nothing.
Example
b is 101, which is PRT, and r is 132, whose low digits 32 make address 17.
b is 101, which is PRT, and r is 132, whose low digits 32 make address 17. The eight PRTs print cells 17 to 24, and the y (144) after them is END.
The second is the truth machine. Its input is the last character; 0 prints once and stops, 1 prints 1 forever. The third is a quine. Its first instruction prints cell 0, and the next one adds 1 to that instruction's own address, so the same two cells print the whole memory in turn.
Ideas it shows
See also
Self-modifying
Write your own in Run Convert a program from 3 pentits, 25 pentytes
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 3-pentits-25-pentytes.
Command line
shib run 3-pentits-25-pentytes -e 'brbsbtbubvbwbxbyyHi World'shib manual 3-pentits-25-pentytesSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/3-pentits-25-pentytes.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org