mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-24 20:10:15 -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:
@@ -40,7 +40,7 @@ def new_board():
|
||||
return board
|
||||
|
||||
|
||||
def print_instructions():
|
||||
def print_instructions() -> None:
|
||||
print(
|
||||
"""
|
||||
HERE IS THE BOARD:
|
||||
@@ -73,7 +73,7 @@ NUMBERS. OK, LET'S BEGIN.
|
||||
)
|
||||
|
||||
|
||||
def print_board(board):
|
||||
def print_board(board) -> None:
|
||||
"""Prints the boards using indexes in the passed parameter"""
|
||||
print(" " * 2 + board[13] + board[14] + board[15])
|
||||
print(" " * 2 + board[22] + board[23] + board[24])
|
||||
@@ -108,7 +108,7 @@ def print_board(board):
|
||||
print(" " * 2 + board[67] + board[68] + board[69])
|
||||
|
||||
|
||||
def play_game():
|
||||
def play_game() -> None:
|
||||
# Create new board
|
||||
board = new_board()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user