Piet
Piet was invented by David Morgan-Mar some time in the last ten years. It is another two-dimensional programming language, like befunge. But unlike every other language I know about the program is a picture. Yes, this is a graphical programming language where you draw a picture and the properties of the pixels in that picture determine the behavior of the language. In fact, the header at the top of this page is a Piet program. Go ahead and download it and try it yourself!
Useful Links
- The official webpage of the language has the complete specification, plus lots of useful info and examples.
- You can try creating some Piet programs right in your browser.
- Wikipedia page
- 99 bottles of beer program:
Tools
Actually we will use Dr. Roche's fork of the interpreter available on github.
Everything you need is already installed on CS department lab machines
in the /courses/roche/413/bin
folder, which should be in your
PATH.
To install on your virtual machine, follow these steps:
-
Run
sudo apt install -y libpng-dev tk groff
-
Download the interpreter from github by running
git clone https://github.com/dsroche/npiet
cd npiet
to that directory and run:./configure make # ignore the warnings you see sudo make install
How I will run your code
The programs you submit should be in a single file
called proj.png
, for either part of the project.
I will test your code in the same environment as the lab
machines in MI 423, using the command
npiet proj.png
Helpful tip: You can use any graphics editor such as GIMP to edit
your images. Or, you can use the npietedit
program that is included
in the installation above! But you may have to go back and forth in order to do
things like resize the image or move things around.
Phase 1 Requirements
For this language, you only need to implement modification A. See the Phase 1 page for details on what this means.
Phase 2
See the Phase 2 Page for the list of suggested
problems. Of the ones listed, I recommend the following as being most
well-suited for piet:
- Compiler (compile to piet from some very simple language - see me)
- Vending Machine
- Frequency count (count how many times each letter occurs, maybe)
- Rock, Paper, Scissors
- ??? (you choose!)