MoreThanZero
A stack of digits that can be added up and printed, and nothing that can loop.
DumbEsolangsOrgUser, 2025 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
DumbEsolangsOrgUser made MoreThanZero in 2025. The name says it has more than zero stacks; it has one. Digits go on it, and the commands take them off, add them up, take them away from each other or print them. There is no jump of any kind, so every program runs once from left to right and stops. The specification itself says it cannot make useful programs.
The machine
| Command | Does |
|---|---|
0 to 9 | Put the digit on the end of the stack |
< > | Take off the first or the last item |
+ | Add the digits; the stack becomes the digits of the sum |
- | Take every later digit from the first; the stack becomes the result |
. | Print the whole stack |
[ ] | Print the first or the last item |
, | Read a character; a letter is dropped |
& | Print the number the digits make as a character |
# | Skip the next character |
Every other character is a comment. That is why the specification writes #6 in its comments; a bare 6 there would go on the stack.
Example
72& prints H.
72& prints H. Then > and < take off the 2 and the 7, and 105& prints i. In 19-. the 9 is taken from the 1, and the stack holds the two characters - and 8.
Patterns it teaches
- Stack machines: one stack, and no control flow at all.
Further
See also
Stack-based
Write your own in Run Convert a program from MoreThanZero
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: morethanzero.
Command line
shib run morethanzero -e '65&'shib manual morethanzeroSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/morethanzero.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org