[RESOLVED] 2D Array

If it makes it clearer, you can do it step by step (I'm usually a friend of this. Once you understood you can wrap it up to more compact code):

byte arrayRead(byte array, byte first, byte second) {
  if(array == 1) {
    int x = first / 8; // the position of the byte
    int y = first % 8; // the position within the byte

    byte flags = values[x][second]; // get the byte you want
    byte flag = flags >> y; // move the flag you want to position 1
    flag = flag & 1; // use a bit mask to hide other bits

    return flag;
  }
 ...
}