Add function type hints

This commit is contained in:
20241144010020 2024-12-03 10:07:18 -03:00
parent 649b5b27f7
commit 6dd9557681
1 changed files with 5 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import random, sys
args = sys.argv
# name, -arguments
def has_argument(args, arg):
def has_argument(args: list[str], arg: str) -> bool:
if len(args) > 1:
if args[1].startswith("-"):
for chr in args[1]:
@ -12,9 +12,9 @@ def has_argument(args, arg):
return True
return False
def num2char(num) -> chr:
def num2char(num: int) -> chr:
return chr(num + 65)
def char2num(char) -> int:
def char2num(char: str) -> int:
return ord(char) - 65
posx = [0, 1, 2, 3, 4]
@ -31,15 +31,13 @@ tl.speed(0)
#funções
def linhax(x,y):
def linhax(x: int, y: int) -> None:
tl.up(); tl.goto(x,y)
tl.down(); tl.goto(x+600,y)
pass
def linhay(x,y):
def linhay(x: int, y: int) -> None:
tl.up(); tl.goto(x,y)
tl.down(); tl.goto(x,y+600)
pass
#radar screen