# puzzlegen.core.block

View Source

     1class Block:
     2  """Block Class: This class represents the individual blocks on the game board. It contains the color of the block and methods to set and get the color."""
     3  def __init__(self, color):
     4    self.color = color
     5
     6  def set_color(self, color):
     7    self.color = color
     8
     9  def get_color(self):
    10    return self.color
    11
    12  def __str__(self):
    13    return f"Colored {self.color} block"
    14
    15  def __repr__(self):
    16    return f"<Color: {self.color}>"

class Block: View Source

     2class Block:
     3  """Block Class: This class represents the individual blocks on the game board. It contains the color of the block and methods to set and get the color."""
     4  def __init__(self, color):
     5    self.color = color
     6
     7  def set_color(self, color):
     8    self.color = color
     9
    10  def get_color(self):
    11    return self.color
    12
    13  def __str__(self):
    14    return f"Colored {self.color} block"
    15
    16  def __repr__(self):
    17    return f"<Color: {self.color}>"

Block Class: This class represents the individual blocks on the game board. It contains the color of the block and methods to set and get the color.

Block(color) View Source

    4  def __init__(self, color):
    5    self.color = color

color
def set_color(self, color): View Source

    7  def set_color(self, color):
    8    self.color = color

def get_color(self): View Source

    10  def get_color(self):
    11    return self.color