Compose the 4 bits at the corners of the cell to build a binary index: walk around the cell in a clockwise direction appending the bit to the index, using bitwise OR and left-shift, from most significant bit at the top left, to least significant bit at the bottom left. The resulting 4-bit index can have 16 possible values in the range 0-15.I can see in the docs that the relevant operators are "|" and "<<" but I've no idea how to apply them. If I have four corners with the values 1,0,0,0 how would I go about building the index - for these values the result should be 7.
As an aside, if anyone can point me to a perl implementation of this algorithm that would be most useful.
Thanks for any help.In reply to Bitwise operations by bangor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |