Curlyfrick
In the graphing program Desmos, {} evaluates to 1. Every number is built from it.
JonoCode9374, 2019 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 5 known programs · Hello World on Try It Online: identical except the line end · Test method
Run it
The idea
A line is an opcode, a tab, and some data. The opcode is four binary digits written with . for 0 and {} for 1, so {}{}.{} is 1101, which is 13, print a character. The data is arithmetic in which {} is the number 1. {}+{} is 2, ({}+{})^({}+{}+{}) is 8, and {}{} is 11, since each {} becomes the digit 1.
The machine
30,000 variables and a pointer. The implementation follows the Python interpreter in JonoCode9374's repository CFEsolang, which is what TIO runs. That interpreter evaluates every line's data with Python before the program starts, and two of its opcodes stop with an error on any program.
| Opcode | Does |
|---|---|
...{} | Print the value |
{}{}.{} | Print the character with that code |
..{}. {}{}{}. | Print the variable; as text only when it is text |
.{}.. .{}.{} | Move the pointer by the value |
.{}{}. | Print > and read a line, as a number when it is one |
.{}{}{} {}... {}.{}. | If, while, end |
{}{}.. {}{}{}{} | Take 1 away; set to 0 |
{}..{} | Comment |
..{}{} {}.{}{} | Store, increment; both stop with a NameError |
An if or a while that fails skips to the next end without counting nesting. A newline is printed when the program ends.
Example
The first program is 2 to the power 11 minus 1.
The first program is 2 to the power 11 minus 1. The last is the truth machine; the > is the prompt the interpreter prints before reading.
Patterns it teaches
- Encoding tricks: two symbols carry both the opcodes and the numbers.
- Camouflage: the program looks like empty sets and dots.
Further
- esolangs.org/wiki/Curlyfrick
- The interpreter, in Python
See also
Also in Camouflage
Write your own in Run Convert a program from Curlyfrick
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: curlyfrick.
Command line
shib run curlyfrick -e '...{} √{}+{})'shib manual curlyfrickSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/curlyfrick.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org