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,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
|
||||
|
||||
Reference in New Issue
Block a user