Program your favorite phrase

Piet (honorary answer)

enter image description here

Snakes its way downwards, running out the right through blue and re-entering through green. Prints out "Fruit flies like a banana."

I used PietCreator to make this, but you can try it out here. Remaking Piet programs is a pain, so I started out at 35x35 and continued that way, meaning that I used a lot more codels than I needed.

Actual size versions

enter image description here enter image description here enter image description here enter image description here enter image description here


><> (42)

Fish are truly the greatest pet. Some people keep bugs as pets due to an incomprehensible lack of logic. This program does its best to reason with such people.

!v'?od gub yna nac tahW;'00p!
<<|ov!
voo <

Note there this is no trailing newline in the program. The full output is reversed in the first line; the complete phrase is "What can any bug do?" (entropy 3.58418).

Full explanation:

This is one of the more fun ><> programs I've written, since this is the first that uses reflection. The first line is where the meat of the program is.

!v is a no-op, as ! causes the next instruction to be skipped.

'?od gub yna nac tahW;' stores the full phrase on the stack (it's backwards because each letter is pushed onto the stack in the order written, so it must be reversed to be popped off nicely).

00p is where the real magic starts happening. Note that it didn't just store the phrase, it also stored a ;. 00p inserts the top character onto the stack into the program at position (0, 0), so now the first character of the program is a ;.

The ending ! skips that semicolon, and moves the cursor onto v, which directs the program flow downwards.

From here on out, it's all just printing routines. Since there's no trailing newline, successive appendings of the program simply add the last two lines, in effect, since the first line will be to the right of voo <, and thus will never be executed.

At the end, the cursor is directed out the bottom left of the program, and wraps back around to the top left, where the ; was inserted earlier, ending the program.


Python 66

i='i'in dir()and i+1;print("Tfpcfhaialetgny"[i::5],end=" ."[i>3]);

Entropy: 3.61635

Ouput:

The fat pig can fly.

Thanks @JasonS and @grc for the tips on shortening the variable detection part.

Update: Do see JasonS' answer for a wicked wraparound trick which pushed this down to 55 bytes. :)