Spaces:
Running
Running
File size: 543 Bytes
641f13e e268213 641f13e e268213 641f13e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from __future__ import annotations
from typing import Optional
from codenames.embedder import EmbeddingIndex
from codenames.dictionary import load_dictionary
_dictionary = load_dictionary()
_index = EmbeddingIndex(_dictionary)
def guesser(clue: str, board_state: list[str], number: int) -> Optional[str]:
"""
Given a clue word, list of unrevealed board words, and the spymaster's
number, return a word to guess, or None to stop guessing.
You can make up to (number + 1) guesses per round.
"""
return board_state[0] |