def check_win_by_step(self, x, y, user, line_number=None):
if not line_number:<EOL><INDENT>line_number = self.win<EOL><DEDENT>for ang in self.angle:<EOL><INDENT>self.win_list = [(x, y)]<EOL>angs = [ang, ang + math.pi]<EOL>line_num = <NUM_LIT:1><EOL>radius = <NUM_LIT:1><EOL>direction = [<NUM_LIT:1>, <NUM_LIT:1>]<EOL>while True:<EOL><INDENT>if line_num == line_number:<EOL><INDENT>return True<EOL><DEDENT>if direction == [<NUM_LIT:0>, <NUM_LIT:0>]:<EOL><INDENT>break<EOL><DEDENT>for ind, a in enumerate(angs):<EOL><INDENT>target_x = int(x + radius*(sign(math.cos(a)))) if direction[ind] else -<NUM_LIT:1><EOL>target_y = int(y - radius*(sign(math.sin(a)))) if direction[ind] else -<NUM_LIT:1><EOL>if target_x < <NUM_LIT:0> or target_y < <NUM_LIT:0> or target_x > self.board_size - <NUM_LIT:1> or target_y > self.board_size - <NUM_LIT:1>:<EOL><INDENT>direction[ind] = <NUM_LIT:0><EOL><DEDENT>elif self.pos[target_x][target_y] == user:<EOL><INDENT>self.win_list.append((target_x, target_y))<EOL>line_num += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>direction[ind] = <NUM_LIT:0><EOL><DEDENT><DEDENT>else:<EOL><INDENT>radius += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>return (x, y)<EOL><DEDENT>
Check winners by current step