def find_words_in_board(): SettingsParser.load_settings() DictionaryParser.load_dictionary( language=SettingsParser.get_setting('language')) boogle_instance = StandardBoggle(1, 4) boogle_instance.game_paralell_process() print(boogle_instance.get_game_end_info())
def test_dictionary_correct(self): SettingsParser.load_settings(silent=True) try: DictionaryParser.load_dictionary(language=SettingsParser.get_setting('language'), silent=True) success = True except SystemExit: success = False self.assertTrue(success)
def rules(self, board_id, move, register_used_word, rules_args=None) -> bool: if move not in self.get_used_words( board_id) and DictionaryParser.check_dict_word(word=move): if register_used_word: self.get_used_words(board_id).append(move) return True return False
def settings_main_menu(exit_command): exit_command[0] = True SettingsParser.save_settings() DictionaryParser.load_dictionary( language=SettingsParser.get_setting('language'))
def main(): SettingsParser.load_settings() DictionaryParser.load_dictionary( language=SettingsParser.get_setting('language')) MenuParser.generate_menu()
def generate_board(): SettingsParser.load_settings() DictionaryParser.load_dictionary( language=SettingsParser.get_setting('language')) boogle_instance = FoggleBoggle(2, 4) print(boogle_instance.get_board_string(0, colored=False))
def mock_game(): SettingsParser.load_settings() DictionaryParser.load_dictionary( language=SettingsParser.get_setting('language')) GameLogic.run_game(boggle_class=StandardBoggle, mockup=True)
def create_board(self, board_size, tile_config_name=None) -> list: tile_config = [[char.lower() for char in row] for row in DictionaryParser.get_dict_meta('tile_configs')[tile_config_name]] return [[BoggleTile(value=choice(tile_config.pop(0))) for column in range(board_size)] for row in range(board_size)]
def test_dictionary_incorrect_files_format(self): path = get_root_dir() / 'tests' / 'test_dict_format_incorrect' try: DictionaryParser.load_dictionary(path, silent=True) except SystemExit as cm: self.assertEqual(cm.code, 6)
def test_dictionary_wrong_filepath(self): path = '/this_dosnt_exist' try: DictionaryParser.load_dictionary(path, silent=True) except SystemExit as cm: self.assertEqual(cm.code, 4)
def load_minimal_language(): path = get_root_dir() / 'tests' / 'test_dict_minimal_lang' DictionaryParser.load_dictionary('complete lang', language_dir=path, silent=True)
def standard_setup(): SettingsParser.load_settings() DictionaryParser.load_dictionary(language=SettingsParser.get_setting('language')) SettingsParser.set_setting('generous_boggle', False) HostIO.set_terminal_output(False)
def display_main_menu(menu_items): HostIO.display_standard_menu(DictionaryParser.get_dict_meta('menu'), menu_items)
def display_settings_menu(menu_items): HostIO.display_standard_menu(DictionaryParser.get_dict_meta('settings'), menu_items)