Przeglądaj źródła

perfecting input argument types

tBKwtWS 1 miesiąc temu
rodzic
commit
0b489840f3
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      karel_asset.py

+ 3 - 3
karel_asset.py

@@ -103,7 +103,7 @@ def relative_move_asset(asset, x:int=0, y:int=0):
     return new_asset
 
 # Move a passed asset in relation to her orientation
-def orientation_move_asset(asset, direction, amount):
+def orientation_move_asset(asset, direction:str, amount:int):
     # Direction translation
     if asset[1][4].startswith("east"):  # East
         if direction.lower() == "forward" or direction.lower() == "front":
@@ -155,7 +155,7 @@ def orientation_move_asset(asset, direction, amount):
     return new_asset
 
 # Move a passed asset to new coordinates
-def absolute_move_asset(asset, x, y):
+def absolute_move_asset(asset, x:int, y:int):
     # Update coordinates in list
     asset[1][1] = x
     asset[1][2] = y
@@ -654,7 +654,7 @@ it may be useful in case of moving in relation to orientation,
 perhaps in coordinated group movements with Karels.
 """
 # Draw a random Karel outside the canvas
-def generate_outofbounds_random_beeper(canvas, side):
+def generate_outofbounds_random_beeper(canvas, side:str):
     size = determine_max_size(canvas)
     
     # Generate random coordinates (Outside the canvas geometry)