mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-21 23:00:43 -08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user