Actor Arrays
Posted: Mon Apr 03, 2006 11:58 pm
I have just noticed that actor variables can't be arrays. I want an array of five 0/1 integers. I think I can do this with a string, but how can I check just one character of a string?
int getT(int i, int values)
{
int result = 0;
int mask = 0;
i-=1;
if (i < 8)
{
mask = 1*pow(2,i);
result = ((values & mask) > 0);
}
return result;
}
int setTValues (int i1, int i2, int i3, int i4, int i5)
{
return
i1 * pow(2,0) +
i2 * pow(2,1) +
i3 * pow(2,2) +
i4 * pow(2,3) +
i5 * pow(2,4);
}
variable = setTValues (1, 0, 0, 1, 1);
getT(2, variable)