mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-21 23:00:43 -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:
@@ -28,7 +28,7 @@ MAX_NUM = 100
|
||||
MAX_GUESSES = 7
|
||||
|
||||
|
||||
def print_instructions():
|
||||
def print_instructions() -> None:
|
||||
"""Instructions on how to play"""
|
||||
print("I am thinking of a whole number from 1 to %d" % MAX_NUM)
|
||||
print("Try to guess my number. After you guess, I")
|
||||
@@ -38,7 +38,7 @@ def print_instructions():
|
||||
print("means really close! You get %d guesses." % MAX_GUESSES)
|
||||
|
||||
|
||||
def print_stars(secret_number, guess):
|
||||
def print_stars(secret_number, guess) -> None:
|
||||
diff = abs(guess - secret_number)
|
||||
stars = ""
|
||||
for i in range(8):
|
||||
|
||||
Reference in New Issue
Block a user