예제 #1
0
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())
예제 #2
0
    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)
예제 #3
0
 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
예제 #4
0
 def settings_main_menu(exit_command):
     exit_command[0] = True
     SettingsParser.save_settings()
     DictionaryParser.load_dictionary(
         language=SettingsParser.get_setting('language'))
예제 #5
0
def main():
    SettingsParser.load_settings()
    DictionaryParser.load_dictionary(
        language=SettingsParser.get_setting('language'))
    MenuParser.generate_menu()
예제 #6
0
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))
예제 #7
0
def mock_game():
    SettingsParser.load_settings()
    DictionaryParser.load_dictionary(
        language=SettingsParser.get_setting('language'))
    GameLogic.run_game(boggle_class=StandardBoggle, mockup=True)
예제 #8
0
 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)]
예제 #9
0
 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)
예제 #10
0
 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)
예제 #11
0
def load_minimal_language():
    path = get_root_dir() / 'tests' / 'test_dict_minimal_lang'
    DictionaryParser.load_dictionary('complete lang', language_dir=path, silent=True)
예제 #12
0
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)
예제 #13
0
 def display_main_menu(menu_items):
     HostIO.display_standard_menu(DictionaryParser.get_dict_meta('menu'), menu_items)
예제 #14
0
 def display_settings_menu(menu_items):
     HostIO.display_standard_menu(DictionaryParser.get_dict_meta('settings'), menu_items)