NPIET(1)

πŸ“¦ version 1.3f, in nixos 26.05, nixpkgs unstable

πŸŽ€ NPIET(1) πŸŽ€

okay so you opened the manual page for npiet, section 1 of the General Commands Manual β€” welcome, bestie, let's get you fluent πŸ’…


✨ NAME ✨

npiet β€” an interpreter for the piet programming language πŸ–ΌοΈ


🌈 SYNOPSIS 🌈

npiet [ -v | -q | -d | -dpbug | -v11 | -t ] [ -e <n> ] [ -tpic ] [ -tpf
<n> ] [ -tps ] [ -ts <n> ] [ -te <n> ] inputfile

πŸ’– DESCRIPTION πŸ’–

So npiet is an interpreter for the piet programming language, and the whole vibe of piet is that the programs are literally pictures, built out of 18 colors plus black and white, where changes in the color are stack-based commands. like, the art is the code, no cap 🎨

If the input (supported is ppm and optional gif and png format) includes unknown colors, they are substituted per default by white (optional by black or leading to an error). choose your fighter ig πŸ™ˆ

The input picture is per default examined, if it is zoomed (for better "readability"), and the zoomfactor (the codelsize) is automatically guessed β€” and if this failes, please specify the codelsize by the -cs option. lowkey she tries her best but sometimes you gotta step in 🫢

Special fun gives the optional output of a trace picture ✨ If the GD library is compiled in, the npiet interpreter can paint the trace of the program run to a png file, named npiet-trace.png. Different zoom factors and additional options lead to varying detail and readability β€” it's giving customization, it's giving options πŸ’…


πŸ’€ OPTIONS πŸ’€

  • -h β€” print usage help and exit. she's helpful, she's brief, she's iconic πŸ‘‘
  • -v β€” be somewhat verbose. not a lot, just somewhat. a lil chattier than usual πŸ—£οΈ
  • -q β€” be more quiet. shhh, she's concentrating 🀫
  • -d β€” print debug output (lot's of more or less cryptic and mostly useless blurb). fr fr it's a lot of nonsense but it's our nonsense πŸ’€
  • -dpbug β€” changes the execution mode of the perl piet interpreter. this changes the behavior when crossing white blocks (wrong interpretation of blocking after white). it's the legacy chaos mode, ok bestie 😭
  • -v11 β€” changes the execution mode to the npiet version 1.1 interpreter. this changes to the first fixed version of corrected behavior when crossing white blocks. the glow-up era ✨
  • -t β€” print trace details. For every step the interpreter print some details:
trace: step 0  (0,0/r,l nB -> 3,0/r,l dB):
action: push, value 9
trace: stack (1 values): 9

The trace step with the codel x,y coordinates and the dp,cc values and the codel color (here: normal Blue to dark Blue). The action describes the command executed and the stack with its values is shown. little step-by-step receipts, we love to see it 🧾

  • -e <n> β€” Sets the number of execution steps. This allows to abort a erroneous program, but the default is unlimited, ie. run until program end (or forever ;-). so yeah, the default is chaos, set this if you fear infinity 😳
  • -tpic β€” Create a trace picture. The file is name npiet-trace.png. The picture is written on program exit, or if the normal trace options is specified too, after every step (makes execution notably slower, because this is quite expensive, but maybe helpful). (only avail if compiled with gd support). art class but make it runtime πŸ–ŒοΈ
  • -tpf <n> β€” Sets the size of the pixel in the trace picture. For small input files, eg. 20x20 codels, the resulting trace picture is 640x640 pixel with a pizel zoom of 32. (yes, 'pizel'. we stan a typo πŸ’…) Just try different values, to get useable readability versus picture size. There are some internal values, where different information is written by different zoom factors. (only avail if compiled with gd support).
  • -tps β€” Do not include the dp/cc tries in the trace picture. This can increase readability with smaller pixel zoom factors. Additional there are some internal values too, where different information is written depending of the zoom factor. (only avail if compiled with gd support). decluttering queen 🧹
  • -ts <n> β€” Please look at -te <n> just below: πŸ‘€
  • -te <n> β€” Values where to start and end when painting a trace picture. To avoid clobbered output when running in loops, for better readability a start and an end step can be specified.
Note: this does not stop or change the program execution or the textual trace output. It affects only the saved image.
Note: this enables now tracing, so specifying -tpic is no longer necessary.
Note: if you specify -te 0 you can easily get an bigger picture of the input saved ;-) πŸ–ΌοΈ
  • inputfile β€” The picture to read. For ppm-formatted pictures this may be a - to read from <stdin>. pipe it in, we love a stdin moment πŸ“

🌸 EXAMPLES 🌸

npiet -tpic hello.gif

run the hello.gif program and create a trace file named npiet-trace.png . that's it, that's the whole tutorial, slayed 🌟


πŸ¦‹ FILES πŸ¦‹

  • npiet-trace.png β€” name of the trace picture file. It is overwritten if it exists. so don't get attached to your old trace, she's getting replaced πŸ™ˆ

πŸ’œ AUTHOR πŸ’œ

Erik Schoenfelder <schoenfr@web.de>. -dpbug option by Bertram Felgenhauer <int-e@gmx.de>.

shoutout to the devs, absolute legends 🫢


🧚 BUGS 🧚

None seen β€” they are hidden in the oil painting ;-) πŸ’€


⭐ SEE ALSO ⭐


and that's the whole page babes ✨ this is npiet v1.3, dated Aug 2011, so like, vintage but make it iconic β€” go paint some code, bestie πŸŽ¨πŸ’–

πŸ“¦ where this page comes from