mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
Python: Add type annotations to all 'print' functions (#662)
* Add test to superstartrek and fixes several issues in superstartrek - I probably introduced them 🙈
* Mastermind type annotations
This commit is contained in:
@@ -26,12 +26,12 @@ phrase = 1
|
||||
line = ""
|
||||
|
||||
|
||||
def print_centered(msg):
|
||||
def print_centered(msg: str) -> None:
|
||||
spaces = " " * ((PAGE_WIDTH - len(msg)) // 2)
|
||||
print(spaces + msg)
|
||||
|
||||
|
||||
def process_phrase_1():
|
||||
def process_phrase_1() -> str:
|
||||
global line
|
||||
|
||||
line_1_options = [
|
||||
@@ -46,7 +46,7 @@ def process_phrase_1():
|
||||
return line
|
||||
|
||||
|
||||
def process_phrase_2():
|
||||
def process_phrase_2() -> None:
|
||||
global line
|
||||
global u
|
||||
|
||||
@@ -63,7 +63,7 @@ def process_phrase_2():
|
||||
u = u_modifier
|
||||
|
||||
|
||||
def process_phrase_3():
|
||||
def process_phrase_3() -> None:
|
||||
global line
|
||||
|
||||
phrases = [
|
||||
@@ -79,7 +79,7 @@ def process_phrase_3():
|
||||
line = line + words
|
||||
|
||||
|
||||
def process_phrase_4():
|
||||
def process_phrase_4() -> None:
|
||||
global line
|
||||
|
||||
phrases = [
|
||||
|
||||
Reference in New Issue
Block a user