class Corner

class Corner():
def __init__(self, startState, corners):
self.corners = corners
self.state = startState
self.touchedCorners = False, False, False, False
self.touch(self.state)

def isGoal(self):
return not False in self.touchedCorners

def Position(self):
return self.state

def touch(self, state):
for i in range(4):
if self.cornersi == state:
self.touchedCornersi = True
self.state = state

def __eq__(self, other):
return self.touchedCorners == other.touchedCorners and self.Position() == other.Position()

if not state.isGoal():
open =

for i in range(4):
if not state.touchedCornersi:
open.append(cornersi)

max = 0

for corner in open:
distance = util.manhattanDistance(state.Position(), corner)
if distance > max:
max = distance

return max

return 0