Munching Squares
This is one of my favorite easy graphical coding doodles. I used it to try out the new (X)HTML 5 <canvas> element.
The algorithm
- For a graph width that is a power of 2, plot x against x xor t.
- Repeat for each t from zero to the graph width.
- When t reaches the graph width, reset it to zero and toggle the plot color from black to white or vice versa