# import settings as S

import pprint
from copy import deepcopy

from logic import Checks as C
from logic import Datatypes as D
from logic import Display
from logic import Game
from logic import Logic as L
from logic import Scratch
from logic import Settings as S
from logic import WordLog as WL
from logic import WordSearch as WS

gameSettings = S.get_game_settings()
S.set_game_settings(settings=gameSettings)


def basics():
    # checks.py
    assert C.is_position_valid("A1") is True
    assert C.is_position_valid("O15") is True
    assert C.is_position_valid("B52") is False
    assert C.is_position_valid("Z6") is False

    assert C.is_coordinate_valid(0, 0) is True
    assert C.is_coordinate_valid(99, 99) is False
    assert C.is_coordinate_valid(75, 0) is False
    assert C.is_coordinate_valid(-1, -1) is False

def word_exists_by_entire_word(word: str):
    word_list = WordSearch.word_list_by_word(word, len(word))
    # print(word_list)
    if word in word_list:
        return True
    return False


LANGUAGE = "german"
# lang = "english"
GAMEMODE = "normal"

# dirty solution.
gameSettings = Settings.get_game_settings(GAMEMODE, LANGUAGE)
Settings.set_game_settings(settings=gameSettings)

Settings.set_rack("ERNSTLUD")

number_of_tests = 10

test_word = "FLÜSTERN"
# print("NEW".center(40, "*"))
# print("OLD".center(40, "*"))
# pprint.pprint(starting_positions_old)

# ## TESTING AREA
# TEST A
test_a_avg = 0
test_a_total = 0