Munching squares

From Rosetta Code
Revision as of 14:20, 28 November 2011 by rosettacode>Dkf (Still a draft; description assumes far too much about the implementation (what's a color table?))
Munching squares is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Render a graphical pattern where each pixel is colored by the value of 'x xor y' from a color table.

Mathematica

Mathematica output #1

Output #1: <lang Mathematica> ListDensityPlot[

Table[Table[
  FromDigits[BitXor[IntegerDigits[x, 2, 8], IntegerDigits[y, 2, 8]], 
   2], {x, 0, 255}], {y, 0, 255}]]

</lang>

Mathematica output #2

Output #2: <lang Mathematica> ArrayPlot[Array[BitXor, {511, 511}]] </lang>