Database changes have finished applying - please report any issues you're (still) seeing to support@shoutwiki.com.

559: Pietfield

From SRoMG Explained
Jump to navigationJump to search
Pietfield
0559.png
Made by: Heikki Kallasjoki


Explanation[edit | edit source]

The author writes:[edit | edit source]

A Garfield strip about painting, slightly tweaked to also be a Piet program that prints out "Garfield".

In order to be more "Piet-compatible", I've converted the whole strip to the 18-colour Piet palette, mostly in a non-dithered fashion, except for the cat, whose trademark orange colour is very non-existent in the Piet palette. The dithering does make him stand out a bit, though.

The program itself runs, at least in npiet:
$ ./npiet pietfield.png
Garfield

And is textually basically this:
push(10); -- '\n'
push(100); -- 'd'
push(108); -- 'l'
push(11621); -- 11621 % 256 == 'e'
push(105); -- 'i'
push(102); -- 'f'
push(114); -- 'r'
push(3169); -- 3169 % 256 == 'a'
push(71); -- 'G'

push(1057); -- \
duplicate; -- | push(0) */
sub; -- /
push(10);
push(1);
roll; -- put the 0 under the '\n'
{ loop: }
duplicate; -- \
not; -- |
not; -- | flip CC if top-of-stack nonzero
switch; -- /
{ terminate unless CC flipped above }
out(char); -- pop and output
{ goto loop }

The large numbers (11621, 3169, 1057) are places where I used existing background blobs as data. The program assumes ASCII, and that out(char) will output only the 8 lowest bits; if it outputs, say, Unicode codepoints, you'd get "G<TELEGU LETTER VOCALIC LL>rfi<TIFINAGH LETTER YAZZ>ld" out.

Here is the trace output from npiet ("-tpic -tpf 3", pietfield-trace.png). It's a bit on the large side (1800×534 pixels), but even so the loop part is a mess. Still, you can see approximately how it goes through the strip.

0559 1.png

Original strip: 2003-10-21.

Transcript[edit | edit source]

Garfield: Jon, I need to express myself.
Garfield: So I've taken up painting.
Garfield: I call it "Stupid in Green."

Trivia[edit | edit source]

The Unicode codepoint output listed in the author's notes would ultimately be properly rendered and utilized in 5301: Gౡrfiⵥld.