Checking multiple values are the same

I want to make sure that 4 values in an array are all different and thought this would work :-

 if (colourBlok[0] != colourBlok[1] != colourBlok[2] != colourBlok[4])

..but it doesn't. Why not and what will please? (apart from the obvious in long code lengths)

Because "!=" will yield "0" or "1" as a result of evaluating the right-most of each expression pair.
Which is OK if the values in your array elements are only "0" or "1", but not otherwise.
Try XOR.

Besides, what happened to [3]?

Oops should have been 3 :-[