copy from onyx opensource project gomoku