A  little thought about this:

Since there are four colors Red, Yellow, Green, or Blue , we can use 2-bit
to represent each color, say

00 -> Red
01 -> Yellow
10 -> Green
11 -> Blue

so in total,  1 byte (unsigned char in C++) should be enough.


For the logic of detecting hits and pHits, the bit operation involved can
be the XOR, i.e.
the XOR result will be zero, if the two color are identical.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to