Neb's Art
An assembly language with no print. You draw the output on a grid, and the grid is shown when the program ends.
HecknTarnation · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
HecknTarnation made Neb's Art. A program is a list of assembly lines that work on a grid of signed 16-bit tiles, a stack of the same numbers and a pointer that starts in the top left corner. No instruction prints a single value. When the program ends, the whole grid is shown, either as numbers or, after ? ascii, as the characters of their codes.
Read the story
So a Hello World makes a grid one row high and twelve tiles long and fills it with letters.
The machine
| Instruction | Does |
|---|---|
# rows columns | Make a grid of 0s; must come first |
? num ? ascii | Show the grid as numbers or as characters |
+ - * / % n | Change the pointed tile by n, or by a popped number |
&< n <& | Push n (or the tile); pop into the tile |
` n | Fill the grid with n | |
< > ^ v n | Move n tiles, stopping at the edge |
( x ) y () x y | Place the pointer |
.( x .) y .= .& | Set the comp flag when the pointer is there, when the top of the stack equals the tile, or when the stack is not empty |
.! -. | Unset the flag; skip to the next .! while it is set |
@ name -> name <- | Mark a line, jump there, return |
->= name n ->< name n ->. name | Jump when the tile equals n, is below n, or the flag is set |
<-> <&> | Reverse the digits of the tile; reverse the stack |
; n ~ | Wait n ms, showing the grid when n is even; end |
A jump pushes the line after it so <- can come back, unless it is ->* or ends in *. The specification does not say how the grid is shown. This implementation shows every row as a line, with numbers split by a space.
Example
The Hello World pushes twelve codes, flips the stack so H is on top, and unloads it one tile to the right…
The Hello World pushes twelve codes, flips the stack so H is on top, and unloads it one tile to the right at a time while .& finds something left.
A loop in num mode. Each tile gets the one before it plus 1, until .( 4 sees the pointer in the last column.
The Snail fills a 10 by 10 grid with spaces and walks a spiral of nine As around the middle.
Further
Ideas it shows
See also
Matrix-based
Write your own in Run Convert a program from Neb's Art
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: neb-s-art.
Command line
shib run neb-s-art -e '# 10 10
? ascii
() 5 5
` 32
&< 65
&< 65
&< 65
&< 65
&< 65
&< 65
&< 65
&< 65
&< 65
&< 65
<&
^
<&
<
<&
<
<&
v
<&
v
<&
>
<&
>
<&
>
<&
~'shib manual neb-s-artSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/neb-s-art.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org