symetryMove function

int symetryMove(
  1. int x,
  2. int symetry
)

Get symetry move list.

See: https://github.com/abulmo/edax-reversi/blob/1ae7c9fe5322ac01975f1b3196e788b0d25c1e10/src/book.c#L542-L550 See: https://github.com/abulmo/edax-reversi/blob/1ae7c9fe5322ac01975f1b3196e788b0d25c1e10/src/move.c#L40-L63

REF: https://choi.lavox.net/edax/ref_command_basic?s[]=symetry#symetry_%E9%9A%A0%E3%81%97%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89

Implementation

int symetryMove(final int x, final int symetry) {
  var x_ = x; // ignore: non_constant_identifier_names
  if (symetry & 1 != 0) {
    x_ = (x_ & _octal070) | (7 - (x_ & 7));
  }
  if (symetry & 2 != 0) {
    x_ = (_octal070 - (x_ & _octal070)) | (x_ & 7);
  }
  if (symetry & 4 != 0) {
    x_ = ((x_ & _octal070) >> 3) | ((x_ & 7) << 3);
  }
  return x_;
}