I take it the complaint is here?
if (RED[i] == 1)
If so, then it makes sense: the type of RED[i] will be char* -
try comparing it with "1" instead.
if (RED[i] == "1")
[edit]
Way too much C#! :laugh:
Try parsing RED[i] to an int and comparing that...
[/edit]