Cuboid
Draw a box in ASCII art, and its volume is the character it prints.
Username1234, 2022 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Username1234 made Cuboid in August 2022. A program is a drawing of boxes in +, -, | and /. Each box has a length, the number of - along an edge, a width, the number of /, and a height, the number of |. It prints the character whose code is the three multiplied. There is nothing else, no input, no loop and no choice, so every program prints one fixed string.
The machine
| Edge | Drawn with | Measures |
|---|---|---|
| Top, front and bottom | - | Length |
| Slanting back | / | Width |
| Upright | | | Height |
Corners are +. The front face is drawn square on, and the top and right faces slant back up to the right. The boxes run in reading order, row by row and left to right, by their top left corners. Every character that is not a space has to belong to a whole box.
Example
The first cuboid is 5 long, 3 wide and 3 high.
The first cuboid is 5 long, 3 wide and 3 high. 5 times 3 times 3 is 45, the code of -.
Two boxes side by side run left to right. The first is 8 by 3 by 3, which is 72, an H. The second is 7 by 3 by 5, which is 105, an i.
The Hello, World! is thirteen boxes in five rows. Its e is a flat bar 101 long, 1 wide and 1 high, and its space is 4 by 2 by 4.
Further
See also
Two-dimensional languages
Write your own in Run Convert a program from Cuboid
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: cuboid.
Command line
shib run cuboid -e ' +-----+
/ /|
/ / |
/ / |
+-----+ +
| | /
| | /
| |/
+-----+'shib manual cuboidSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/cuboid.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org