Skip to content
Snippets Groups Projects
is_goal.py 267 B
Newer Older
Michael Mutote's avatar
Michael Mutote committed
MAZE_GOAL = (0, 4)
Michael Mutote's avatar
Michael Mutote committed


Michael Mutote's avatar
Michael Mutote committed
def is_goal_maze(state):
    return MAZE_GOAL == state


def is_goal_sudoku(state):
    y, x = 10, 10
    for i, s in enumerate(state):
        if 0 in s:
            (y, x) = (i, s.index(0))
            break
    return ((y, x) == (10, 10))