/racket-piet

A Racket implementation of Piet, an image programming language

Primary LanguageRacket

racket-piet

Base implementation by stevengeeky (https://github.com/stevengeeky) and mofas (https://github.com/mofas)

Installation

raco pkg install https://github.com/stevengeeky/racket-piet.git

Usage

Make a new example.rkt file and in DrRacket type

#lang racket-piet

codal-size 11

hello-world.png

Make sure you include the image in the file, since the image is the program to run.

If you're going to run the above program, make sure you right-click and save the image first, then insert it into DrRacket by going to Insert->Image. If you copy and paste the image into DrRacket, it will have antialiasing and will not be correctly compiled.

Examples

Courtesy of http://www.dangermouse.net/esoteric/piet/samples.html

All of these programs have a codal size of 11.

Hello World 2

hello-world-2.png

Factorial

fact.png

A2Z

a-z.png

"Tetris"

tetris.png

Fibonacci

fib.png

∀ k > 0 . k

naturals.png

∀ k ≥ 0 . 2k

powers-of-2.png