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,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()