mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-26 12:51:29 -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:
@@ -181,7 +181,7 @@ def display(Game: TicTacToe) -> None:
|
||||
print(line1, "\n\n")
|
||||
|
||||
|
||||
def play() -> None:
|
||||
def main() -> None:
|
||||
Pick = input("Pick 'X' or 'O' ").strip().upper()
|
||||
if Pick == "O":
|
||||
Game = TicTacToe("O")
|
||||
@@ -219,4 +219,4 @@ def play() -> None:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
play()
|
||||
main()
|
||||
|
||||
@@ -191,7 +191,7 @@ def prompt_player(board):
|
||||
return move
|
||||
|
||||
|
||||
def play():
|
||||
def main():
|
||||
print(" " * 30 + "TIC-TAC-TOE")
|
||||
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
|
||||
print("\n\n")
|
||||
@@ -247,4 +247,4 @@ def play():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
play()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user