Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lezyonish committed Jan 21, 2025
1 parent 3b11380 commit 8c44c35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions homework04/life_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def __init__(self, life: GameOfLife) -> None:
super().__init__(life)

def draw_borders(self, screen) -> None:
""" Отобразить рамку. """
"""Отобразить рамку."""
pass

def draw_grid(self, screen) -> None:
""" Отобразить состояние клеток. """
"""Отобразить состояние клеток."""
pass

def run(self) -> None:
Expand Down
8 changes: 3 additions & 5 deletions homework04/life_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@


class GameOfLife:
def __init__(
self, width: int = 640, height: int = 480, cell_size: int = 10, speed: int = 10
) -> None:
def __init__(self, width: int = 640, height: int = 480, cell_size: int = 10, speed: int = 10) -> None:
self.width = width
self.height = height
self.cell_size = cell_size
Expand All @@ -30,14 +28,14 @@ def __init__(
self.speed = speed

def draw_lines(self) -> None:
""" Отрисовать сетку """
"""Отрисовать сетку"""
for x in range(0, self.width, self.cell_size):
pygame.draw.line(self.screen, pygame.Color("black"), (x, 0), (x, self.height))
for y in range(0, self.height, self.cell_size):
pygame.draw.line(self.screen, pygame.Color("black"), (0, y), (self.width, y))

def run(self) -> None:
""" Запустить игру """
"""Запустить игру"""
pygame.init()
clock = pygame.time.Clock()
pygame.display.set_caption("Game of Life")
Expand Down

0 comments on commit 8c44c35

Please sign in to comment.