Skip to content

Commit af84b6c

Browse files
Prateek KhandelwalPrateek Khandelwal
Prateek Khandelwal
authored and
Prateek Khandelwal
committed
Added type hints
1 parent 3debdbc commit af84b6c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

machine_learning/minimax.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import math
2+
from typing import List
23

3-
4-
def minimax(depth, node_index, is_maximizing_player, scores, height):
4+
def minimax(depth: int, node_index: int, is_maximizing_player: bool,
5+
scores: List[int], height: int) -> int:
56
"""
67
Minimax algorithm to determine the optimal move for a player in a two-player
78
zero-sum game.

machine_learning/minimax_alpha_beta_pruning.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import math
2+
from typing import List
23

3-
4-
def minimax_with_pruning(
5-
depth, node_index, is_maximizing_player, scores, height, alpha, beta
6-
):
4+
def minimax_with_pruning(depth: int, node_index: int, is_maximizing_player: bool,
5+
scores: List[int], height: int, alpha: int, beta: int) -> int:
76
"""
87
Minimax algorithm with alpha-beta pruning to determine the optimal
98
move with improved efficiency.

0 commit comments

Comments
 (0)