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 @@
"""
Original game design: Cram, Goodie, Hibbard Lexington H.S.
Modifications: G. Paul, R. Hess (Ties), 1973
"""
import math
from typing import List
def tab(n: int) -> str:
return " " * n
def get_choice(prompt: str, choices: List[str]) -> str:
while True:
choice = input(prompt)
@@ -96,13 +96,9 @@ def main():
salaries = {}
ammunition = {}
oa = {}
print(tab(26) + "CIVIL WAR")
print(tab(15) + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
print()
print()
print()
# Original game design: Cram, Goodie, Hibbard Lexington H.S.
# Modifications: G. Paul, R. Hess (Ties), 1973
print(" " * 26 + "CIVIL WAR")
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n")
# Union info on likely confederate strategy
sa[1] = 25
sa[2] = 25