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