def open_classic_page():
    frontend.show_title("Sudoku")
    frontend.show_divider_line()
    show_classic_menu()
    frontend.show_divider_line()
    user_input = get_classic_menu_input()

    return user_input
Example #2
0
def open_diagonal_page():
    frontend.show_title("Sudoku")
    frontend.show_divider_line()
    show_diagonal_menu()
    frontend.show_divider_line()
    user_input = get_diagonal_menu_input()

    return user_input
Example #3
0
def open_menu_page():
    term = Terminal()

    frontend.show_title("Sudoku")
    frontend.show_divider_line()
    show_menu()
    frontend.show_divider_line()
    user_input = get_main_menu_input()

    return user_input
Example #4
0
def show_diagonal_game(puzzle_name, puzzle_grid):
    term = Terminal()

    blanks = backend.count_blank(puzzle_grid)

    while blanks > 0:

        frontend.clear_screen()

        frontend.show_title("Diagonal Mode")
        frontend.show_divider_line()

        print()
        print(term.center("Level: " + puzzle_name))
        print()

        frontend.show_puzzle(puzzle_grid)

        print()
        frontend.show_divider_line()
        print()

        value_input = get_value_input()
        position_input = get_position_input(puzzle_grid)
        puzzle_grid = backend.put_to_grid(value_input, position_input,
                                          puzzle_grid)

        blanks = backend.count_blank(puzzle_grid)

    frontend.clear_screen()

    frontend.show_puzzle(puzzle_grid)

    puzzle_grid = backend.decolorize_grid(puzzle_grid)

    frontend.show_checking_message()
    time.sleep(1)
    frontend.clear_screen()

    answer_grid_name = backend.get_puzzle_answer_name(puzzle_name)
    answer_location = backend.get_file_location("diagonal_puzzles_answers",
                                                answer_grid_name)
    answer_string = backend.get_file_string(answer_location)
    answer_grid = backend.get_grid(answer_string)

    checked_grid = backend.get_checked_grid(puzzle_grid, answer_grid)
    mistakes = backend.count_mistakes(checked_grid)

    frontend.clear_screen()

    frontend.show_mistakes_message(mistakes)
    frontend.show_puzzle(checked_grid)