Munching squares: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
(Still a draft; description assumes far too much about the implementation (what's a color table?))
Line 1: Line 1:
{{task|Raster graphics operations}}[[Category:Graphics algorithms]]
{{draft task|Raster graphics operations}}[[Category:Graphics algorithms]]
Render a graphical pattern where each pixel is colored by the value of 'x xor y' from a color table.
Render a graphical pattern where each pixel is colored by the value of 'x xor y' from a color table.



Revision as of 14:20, 28 November 2011

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>