def draw_O(self, logical_position):
      logical_position = np.array(logical_position)
      # logical_position = grid value on the board
      # grid_position = actual pixel values of the center of the grid
      grid_position = self.convert_logical_to_grid_position(logical_position)
      self.canvas.create_oval(grid_position[0] - symbol_size, grid_position[1] - symbol_size,
        grid_position[0] + symbol_size, grid_position[1] + symbol_size, width=symbol_thickness,
        outline=symbol_O_color)

      Python language logo
      logicalpositionaxis

      here, DrawO is a function that takes in an integer value representing the grid position in the coordinate system of the board (logical position), and then translates it to a pixel value in the same coordinate system. It uses this grid value to create an oval on the canvas with the same dimensions as the grid position, and fills it with the color of the symbol at the given grid position. Finally, it sets the outline color to the same color as the symbol.

      Shortcut: logicalposition.axis

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.