Printscript
A print command that skips one character after its name, whatever that character is.
A, 2019 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 8 known programs · Test method
Run it
The idea
The esolangs.org user A made Printscript in 2019, after Lua. It can print strings, and from version 4 on it has one-character variables. It has no loops and no conditions.
Read the story
The parser does not look for a space after print. It skips exactly one character, so printf"hi" prints hi too. Before version 3 a string that never closed made the interpreter print spaces until there was no more space for code; version 3 prints an error instead.
The machine
| Command | Does |
|---|---|
print "text" | Print the text, line breaks included, up to the next quote |
print x | Print the variable x |
set x c | Set x to the character c |
sev x y | Set x to the value of y |
Inside a string \ makes the next character literal, so \" prints a quote and \n prints n. Anything between commands is passed over, so one print can follow the closing quote of the last.
Example
The last one skips the quote as the character after print, so no string starts at all.
The last one skips the quote as the character after print, so no string starts at all.
Further
Ideas it shows
See also
Also in Jokes
Write your own in Run Convert a program from Printscript
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: printscript.
Command line
shib run printscript -e 'print"'shib manual printscriptSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/printscript.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org