Skip to content

Commit

Permalink
Naive hinter fix - handle case where no Gray cards are on the board.
Browse files Browse the repository at this point in the history
  • Loading branch information
asaf-kali committed Sep 30, 2023
1 parent b5d899d commit c884800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[tool.poetry]
name = "codenames-solvers"
version = "1.4.9"
version = "1.4.10"
description = "Solvers implementation for Codenames board game in python."
authors = ["Asaf Kali <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion solvers/naive/naive_hinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def proposal_from_similarity(
hint_word=self.board_format(hint),
hint_word_frequency=self.get_word_frequency(hint),
distance_group=np.max(hint_to_group),
distance_gray=np.min(hint_to_gray),
distance_gray=np.min(hint_to_gray) if hint_to_gray.size > 0 else 1,
distance_opponent=np.min(hint_to_opponent),
distance_black=np.min(hint_to_black),
board_distances=self._get_board_distances_dict(board_distances),
Expand Down

0 comments on commit c884800

Please sign in to comment.