Esempio n. 1
0
 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
Esempio n. 2
0
def test_contains():
    lex = Lexicon()
    assert 'CAT' in lex
Esempio n. 3
0
def test_contains():
    lex = Lexicon()
    assert lex.contains('Cat')
    assert lex.contains('eifwij') == False
Esempio n. 4
0
def test_init():
    lex = Lexicon()
Esempio n. 5
0
def test_list_words():
    lex = Lexicon()
    assert len(lex.list_words()) == 197888
Esempio n. 6
0
def test_contains_word_or_prefix():
    lex = Lexicon()
    assert lex.contains_word_or_prefix('catas')
    assert lex.contains_word_or_prefix('blimp')
Esempio n. 7
0
def test_contains_prefix():
    lex = Lexicon()
    assert lex.contains_prefix('catas')
Esempio n. 8
0
def test_starts_with():
    lex = Lexicon()
    assert len(lex.starts_with("abomin")) == 6