mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-27 13:14:15 -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,11 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Ported to Python by @iamtraction
|
||||
|
||||
"""Ported to Python by @iamtraction"""
|
||||
|
||||
from random import random
|
||||
|
||||
|
||||
def direction(A, B, X, Y):
|
||||
def direction(A, B, X, Y) -> None:
|
||||
"""Prints the direction hint for finding the hurkle."""
|
||||
|
||||
print("GO ", end="")
|
||||
@@ -22,7 +22,7 @@ def direction(A, B, X, Y):
|
||||
print()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main() -> None:
|
||||
print(" " * 33 + "HURKLE")
|
||||
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
|
||||
|
||||
@@ -63,3 +63,7 @@ if __name__ == "__main__":
|
||||
continue
|
||||
|
||||
print("\n\nLET'S PLAY AGAIN, HURKLE IS HIDING.\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user