Skip to content
Snippets Groups Projects
is_goal.py 374 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
Michael Mutote's avatar
Michael Mutote committed
    return (y, x) == (10, 10)
Michael Mutote's avatar
Michael Mutote committed

Michael Mutote's avatar
Michael Mutote committed

Michael Mutote's avatar
Michael Mutote committed
def is_goal_queens(state):
    return sum(map(sum, state)) == len(state)
Michael Mutote's avatar
Michael Mutote committed


Michael Mutote's avatar
Michael Mutote committed
def is_goal_puzzle(state):
    pass