forked from 20241144010013/20241144010013
Add function type hints
This commit is contained in:
parent
649b5b27f7
commit
6dd9557681
12
src/main.py
12
src/main.py
|
@ -4,7 +4,7 @@ import random, sys
|
||||||
|
|
||||||
args = sys.argv
|
args = sys.argv
|
||||||
# name, -arguments
|
# name, -arguments
|
||||||
def has_argument(args, arg):
|
def has_argument(args: list[str], arg: str) -> bool:
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
if args[1].startswith("-"):
|
if args[1].startswith("-"):
|
||||||
for chr in args[1]:
|
for chr in args[1]:
|
||||||
|
@ -12,9 +12,9 @@ def has_argument(args, arg):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def num2char(num) -> chr:
|
def num2char(num: int) -> chr:
|
||||||
return chr(num + 65)
|
return chr(num + 65)
|
||||||
def char2num(char) -> int:
|
def char2num(char: str) -> int:
|
||||||
return ord(char) - 65
|
return ord(char) - 65
|
||||||
|
|
||||||
posx = [0, 1, 2, 3, 4]
|
posx = [0, 1, 2, 3, 4]
|
||||||
|
@ -31,15 +31,13 @@ tl.speed(0)
|
||||||
|
|
||||||
|
|
||||||
#funções
|
#funções
|
||||||
def linhax(x,y):
|
def linhax(x: int, y: int) -> None:
|
||||||
tl.up(); tl.goto(x,y)
|
tl.up(); tl.goto(x,y)
|
||||||
tl.down(); tl.goto(x+600,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.up(); tl.goto(x,y)
|
||||||
tl.down(); tl.goto(x,y+600)
|
tl.down(); tl.goto(x,y+600)
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
#radar screen
|
#radar screen
|
||||||
|
|
Loading…
Reference in New Issue