x4d

18,757
0
Published 2017-10-24
XOR is bitwise operation like AND an OR. This operation is in almost every processor, and is one of the fastest.

Xor can be used to create fractal-like images. Search "xor fractal" and "munching squares" in the web for example images.

algorithm is:
for each color randomize t and plot (d1+t)^(d2+t)^(d3+t)^(d4+t), where d1-d4 is distance from corners, and ^ is xor operation.

Unfortunately scratch not provide a native xor operation and must be computed algorithmically. It make the process of generating image slow, so used look-up tables.

More info:
https://scratch.mit.edu/projects/45866914/
https://en.wikipedia.org/wiki/Bitwise_operation
https://en.wikipedia.org/wiki/Lookup_table