staircasemaker
The program walks down a staircase, one character on every step.
2020 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
staircasemaker is the sequel to laddermaker, and is also called laddermaker++. Where laddermaker stacks its program in a straight column, staircasemaker slants it. Every line holds one character, one space further in than the line before, so a Hello world is a flight of 17 steps.
Read the story
There is no loop and no condition. A program prints messages, reads lines of input, keeps them in a tape of cells and prints them back, once, from the top step to the bottom.
The machine
| Char | Does |
|---|---|
# = | Begin and end the program |
% & | Begin and end a message |
@ | A space in a message |
? | Print the next character as it is |
~ | Print the current cell in a message |
$ | Read a line of input |
! | Store that line in the current cell |
> < | Move to the next or previous cell |
Inside a message every other character prints itself, which is why the Hello world escapes its !. The specification shows its rules for each mode in a state diagram, which is an image. In this implementation #, =, %, $, !, < and > stop the run inside a message, and any other character stops it outside one. Whitespace is skipped, so a program on one line runs the same as its staircase.
Example
The two input programs, written flat.
The two input programs, written flat. The second keeps the first name in cell 0 and the last name in cell 1, then walks back to print both.
Further
See also
Also in Jokes
Write your own in Run Convert a program from staircasemaker
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: staircasemaker.
Command line
shib run staircasemaker -e '#
%
H
e
l
l
o
@
w
o
r
l
d
?
!
&
='shib manual staircasemakerSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/staircasemaker.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org