def __init__(self, players: List[Player], bag: Bag): """ A class representing a crossword game. :param players: A list of players to participate in this game. 'None' should be used in this List as a placeholder for any player clients yet to join. """ self.players = players self.bag = bag self.active_player = None self.board = GameBoard() self.lexicon = Lexicon() self.validator = MoveValidator(self.lexicon, self.board) self.game_state = GameState.PENDING self.record_of_moves = {} self.move_number = 0
def test_contains(): lex = Lexicon() assert 'CAT' in lex
def test_contains(): lex = Lexicon() assert lex.contains('Cat') assert lex.contains('eifwij') == False
def test_init(): lex = Lexicon()
def test_list_words(): lex = Lexicon() assert len(lex.list_words()) == 197888
def test_contains_word_or_prefix(): lex = Lexicon() assert lex.contains_word_or_prefix('catas') assert lex.contains_word_or_prefix('blimp')
def test_contains_prefix(): lex = Lexicon() assert lex.contains_prefix('catas')
def test_starts_with(): lex = Lexicon() assert len(lex.starts_with("abomin")) == 6