anderium.github.io

View My GitHub Profile

piet

The programming language Piet is for creating abstract art that can function as a program. Piet programs are images, where each codel (square group of pixels) has a meaning depending on transitions to its neighbours. There is also an ASCII implementation, but developing with this is obviously less exciting.

You can find a great editor on piet.bubbler.one, thanks Bubbler-4!

Example program

Piet program that outputs “anderium”.

sccc flisvn
sckc d???vm
ssk?uu ? ve
 aknv vvv d
maknfr j vn
mmknf  nvvj
  uvf jj?v
tdu cbjjcc
ttvrfeiaec

Golfing

Golfing refers to the process of writing code that minimises the number of characters in the solution. It’s a common hobby for people programming in weird languages, and pretty fun to try. For this language, there aren’t technically characters, only pixels, but there are multiple things golfing can mean. Firstly you can try to minimise the area of the program. Secondly, you can try to minimise the number of characters in the ascii-piet translation. I believe in both cases, your best option is to have a wide program with very little height. (The minimum height is 2, but 3 can be better depending on the loop.)

I tried to minimise the example program above, and as a consequence the middle 3×1 dark yellow is used 3 distinct times. The first two cyan blocks are also used twice! I have a simpler example on CodeGolf stackexchange with an explanation how it works as well.