def rotate_board(self, angle, unit='<STR_LIT>'):
if unit == '<STR_LIT>':<EOL><INDENT>angle = angle*math.pi/<NUM_LIT><EOL><DEDENT>angle %= <NUM_LIT:2>*math.pi<EOL>if angle not in [<NUM_LIT:0>, math.pi/<NUM_LIT:2>, math.pi, math.pi*<NUM_LIT:3>/<NUM_LIT:2>]:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>new_pos = [[<NUM_LIT:0> for _ in self.pos_range] for _ in self.pos_range]<EOL>cos_ang = math.cos(angle)<EOL>sin_ang = math.sin(angle)<EOL>center = (self.board_size - <NUM_LIT:1>)/<NUM_LIT:2><EOL>for x, y in comb(self.pos_range, <NUM_LIT:2>):<EOL><INDENT>xt = int((x - center)*cos_ang - (y - center)*sin_ang + center)<EOL>yt = int((x - center)*sin_ang + (y - center)*cos_ang + center)<EOL>new_pos[xt][yt] = self.pos[x][y]<EOL><DEDENT>return new_pos<EOL>
Rotate the chessboard for a specific angle,
        angle must be integral multiple of pi/2(90 degree)