This is an old revision of this page, as edited by Sjrct(talk | contribs) at 23:24, 10 February 2013(Trimmed External Links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 23:24, 10 February 2013 by Sjrct(talk | contribs)(Trimmed External Links)
This article needs attention from an expert in Computing. Please add a reason or a talk parameter to this template to explain the issue with the article.WikiProject Computing may be able to help recruit an expert.(December 2012)
Piet program that prints 'Piet'A "Hello World" program in Piet
Piet is an esoteric programming language designed by David Morgan-Mar, whose programs are bitmaps that look like abstract art. The compilation is guided by a "pointer" that moves around the image, from one continuous coloured region to the next. Procedures are carried through when the pointer exits a region.
There are 20 colours for which behaviour is specified: 18 "colourful" colours, which are ordered by a 6-step hue cycle and a 3-step brightness cycle; and black and white which are not ordered. When exiting a "colourful" colour and entering another one, the performed procedure is determined by the number of steps of change in hue and brightness. Black cannot be entered; when the pointer tries to enter a black region, the rules of choosing the next block are changed instead. If all possible rules are tried, the program terminates. Regions outside the borders of the image are also treated as black. White does not perform operations, but allows the pointer to "pass through". The behaviour of colours other than the 20 specified is left to the compiler or interpreter.
Variables are stored in memory as signed integers in a single stack. Most specified procedures deal with operations on that stack, others with input/output and with the rules by which the compilation pointer moves.
Piet was named after the Dutch painter Piet Mondrian. The originally intended name, Mondrian, was already taken.