Simplify Python Code

print_with_tab / print_with_whitespace is trivial with Python
string formatting and was mostly used in only 2 lines.
This commit is contained in:
Martin Thoma
2022-04-02 07:32:09 +02:00
parent 354c1f9ab3
commit c500424956
47 changed files with 208 additions and 387 deletions

View File

@@ -1,7 +1,7 @@
import random
import enum
from typing import List, Tuple
import random
from dataclasses import dataclass
from typing import List, Tuple
# Python translation by Frank Palazzolo - 2/2021
@@ -77,18 +77,15 @@ EXIT_RIGHT = 2
def main() -> None:
welcome_header()
print_intro()
width, length = get_maze_dimensions()
maze = build_maze(width, length)
maze.display()
def welcome_header() -> None:
def print_intro() -> None:
print(" " * 28 + "AMAZING PROGRAM")
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
print()
print()
print()
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n")
def build_maze(width: int, length: int) -> Maze: