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
The computer has four slots containing balls that are Red, Yellow, Green,
or Blue. eg RGYB or RRGB..
you as a user trying to guess it. You may for ex guess this as RRGY, if you
guess a color right at same position, it is a hit, however, if you guess
the colour there which is there in original