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:
@@ -165,7 +165,7 @@ class TicTacToe:
|
||||
return c1 - gap + i, c2 + gap
|
||||
|
||||
|
||||
def display(Game: TicTacToe):
|
||||
def display(Game: TicTacToe) -> None:
|
||||
line1 = ""
|
||||
for i in range(0, Game.dim_sz):
|
||||
for j in range(0, Game.dim_sz - 1):
|
||||
@@ -181,7 +181,7 @@ def display(Game: TicTacToe):
|
||||
print(line1, "\n\n")
|
||||
|
||||
|
||||
def play():
|
||||
def play() -> None:
|
||||
Pick = input("Pick 'X' or 'O' ").strip().upper()
|
||||
if Pick == "O":
|
||||
Game = TicTacToe("O")
|
||||
|
||||
Reference in New Issue
Block a user