isMasked static method

bool isMasked(
  1. int mask,
  2. int i,
  3. int j
)

Implementation

static bool isMasked(int mask, int i, int j) {
  switch (mask) {
    case 0:
      return ((i + j) & 0x01) == 0;
    case 1:
      return (i & 0x01) == 0;
    case 2:
      return j % 3 == 0;
    case 3:
      return (i + j) % 3 == 0;
    case 4:
      return (((i ~/ 2) + (j ~/ 3)) & 0x01) == 0;
    case 5:
      return (i * j) % 6 == 0;
    case 6:
      return ((i * j) % 6) < 3;
    case 7:
      return ((i + j + ((i * j) % 3)) & 0x01) == 0;
    default:
      return false;
  }
}