def set_pos(self, pos, check=False):
self.validate_pos(pos)<EOL>x, y = pos<EOL>user = self.get_player()<EOL>self.history[self._game_round] = copy.deepcopy(self.pos)<EOL>self.pos[x][y] = user<EOL>pos_str = self._cal_key(pos)<EOL>self._pos_dict[pos_str] = user<EOL>self._user_pos_dict[user].append(pos)<EOL>self._game_round += <NUM_LIT:1><EOL>if check:<EOL><INDENT>winning = self.check_win_by_step(x, y, user)<EOL>return winning<EOL><DEDENT>else:<EOL><INDENT>return (x, y)<EOL><DEDENT>
Set a chess