Draw A Sierpinski Triangle
HTML + JavaScript, 150 characters (see notes for 126 characters)

Whitespace inserted for readability and not counted.

&lt;title&gt;&lt;/title&gt;&lt;canvas&gt;&lt;/canvas&gt;&lt;script&gt;
for(x=k=128;x--;)for(y=k;y--;)
  x&amp;y||document.body.firstChild.getContext("2d").fillRect(x-~y/2,k-y,1,1)
&lt;/script&gt;


The core of it is applying the rule of coloring pixels for which x &amp; y == 0 by the conditional x&amp;y||, which produces a “Sierpinski right triangle”; and x-~y/2,k-y are a coordinate transformation to produce the approximately equilateral display.



A less correct (HTML-wise) version is 126 characters:

&lt;canvas&gt;&lt;script&gt;
for(x=k=128;x--;)for(y=k;y--;)
  x&amp;y||document.body.firstChild.getContext("2d").fillRect(x-~y/2,k-y,1,1)
&lt;/script&gt;


(The way in which this is less correct is that it omits the title element and the end tag of the canvas element, both of which are required for a correct document even though omitting them does not change the interpretation of the document.)

Three characters can be saved by eliminating k in favor of the constant 64, at the cost of a smaller result; I wouldn't count the 8 option as it has insufficient detail.

Note that a size of 256 or higher requires attributes on the &lt;canvas&gt; to increase the canvas size from the default.