KYS
A brainfuck with a print buffer and two commands that add whole texts at once.
WeCantRelate · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
WeCantRelate made KYS in Ruby one night, out of boredom, the specification says. It is a brainfuck with other symbols. Nothing is printed straight away. Every character goes into an output buffer first, and the buffer comes out when the program stops. Two commands add a whole text to the buffer in one step. @ adds Hello, World! and / adds a meme of 561 characters about a rubber room.
The machine
| Command | Does |
|---|---|
) ( | Add 1 to the cell, take 1 away |
! ? | Move right, move left |
$ | Add the cell as a character to the buffer |
@ | Add Hello, World! to the buffer |
/ | Add the long text to the buffer |
* | Set the cell to a random number from 0 to 255 |
< > | Loop |
# | Stop and print the buffer |
The specification leaves the details open. In this implementation cells hold 0 to 255 and wrap, < and > loop as [ and ] do in brainfuck, the buffer is also printed when the program runs out, and * draws from a fixed seed so a run replays.
Example
The second program counts 8 in the first cell and adds 8 to the second cell 8 times.
The second program counts 8 in the first cell and adds 8 to the second cell 8 times. One more makes 65, and $ adds the A. The other programs add the long text with /, once or 11 times.
Further
See also
Cell-based
Write your own in Run Convert a program from KYS
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: kys.
Command line
shib run kys -e '@'shib manual kysSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/kys.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org