Learn PIET with Real Code Examples
Updated Nov 25, 2025
Code Sample Descriptions
1
Hello World in Piet
[Piet programs are images, not text - this would be a bitmap of color regions spelling out 'Hello World!']
A Piet 'Hello World!' program is an image composed of colored blocks. The code below is just a placeholder; actual execution requires an interpreter that processes the image.
2
Print 'Hi' in Piet
[Piet programs are images, not text - this image would contain color regions that output 'Hi']
A Piet program to output 'Hi'; represented as an image.
3
Simple Counter in Piet
[Piet programs are images, not text - this image would have regions representing the counting logic]
A Piet program that counts from 1 to 5 and prints numbers.
4
Print Digits 0-9 in Piet
[Piet programs are images, not text - color blocks represent sequential digits output]
A Piet program to print digits 0 through 9.
5
Simple Loop in Piet
[Piet programs are images, not text - image would contain loop with directional pointer changes]
Demonstrates a looping construct using Piet's directional transitions.
6
Print Alphabet A-Z in Piet
[Piet programs are images, not text - each letter represented via color transitions]
Prints uppercase letters A-Z using color-coded instructions.
7
Fibonacci Sequence in Piet
[Piet programs are images, not text - blocks represent arithmetic operations to produce Fibonacci numbers]
Generates a short Fibonacci sequence as output.
8
Print 'Bye!' in Piet
[Piet programs are images, not text - image contains color regions encoding 'Bye!']
Outputs 'Bye!' as a demonstration of Piet program flow.
9
Simple Arithmetic in Piet
[Piet programs are images, not text - arithmetic simulated via color changes]
Performs arithmetic operations and prints results.
10
Nested Loop Output in Piet
[Piet programs are images, not text - nested loops achieved through color pointer navigation]
Demonstrates nested loops producing sequential output.