Piet Mondrian

I came across a question “determine the sum of digits in the number 2 ^ 1043.” This ended up resulting in an e-mail chain of people posting the short little programs they wrote to produce the answer. There were answers in Perl, Python, Ruby, and some esoteric languages like Befunge-98. Well I decided to hop on the band wagon and try my hand at an esoteric language I have been wanting to play with for a while. So I picked up Piet¬†and got to it.

Piet is a language inspired by the paintings of Piet Mondrian. You program in a 2D space using 20 basic colors. What made it pretty tricky was that the interpreter I was using only stores numbers in 32 bits, so I had to split the result across many entries and handle carrying overflow bits from one entry to the next. I finally got it working after a few days of tedious color picking and debugging. Here is the result:


This entry was posted in Uncategorized. Bookmark the permalink. Both comments and trackbacks are currently closed.