Commit 60682005 authored by Anthony Jacob's avatar Anthony Jacob
Browse files

format file to meet flake and black coding style

parent 0898b765
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@ from pythonsnake.snake import Snake


class Candy:
    def __init__(self, grid_width: int, grid_height: int, snake: Snake) -> None:
    def __init__(self, grid_width: int,
                 grid_height: int,
                 snake: Snake) -> None:
        self.X = 0
        self.Y = 0
        self.random_coord(grid_width, grid_height, snake)
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class Snake:
                    "y": snake_to_shift[i - 1]["y"],
                }

        if self.piece_pending != None:
        if self.piece_pending is not None:
            self.coord.append(
                {"x": self.piece_pending["x"], "y": self.piece_pending["y"]}
            )
+7 −5
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ class TerminalView:
        os.system("cls" if os.name == "nt" else "clear")

    def display_grid(self, gameState: Game) -> None:
        if(self.in_progress == True):
        if (self.in_progress is True):
            return None

        self.in_progress = True
@@ -29,12 +29,12 @@ class TerminalView:
                    grid_to_print += "|"

                # display user
                if column["snake"] == True:
                if column["snake"] is True:
                    grid_to_print += (
                        terminalColor.OKGREEN + "X" + terminalColor.ENDC
                    )
                # display candy except if same coord as player
                elif column["candy"] == True:
                elif column["candy"] is True:
                    grid_to_print += (
                        terminalColor.OKBLUE + "O" + terminalColor.ENDC
                    )
@@ -93,5 +93,7 @@ class TerminalView:

    def menu_choice_incorrect(self) -> None:
        print(
            terminalColor.FAIL, "le choix n'est pas correct", terminalColor.ENDC
            terminalColor.FAIL,
            "le choix n'est pas correct",
            terminalColor.ENDC
        )