Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def openAroundZero(self, c):
  2.   xleft= -1 if c.x>0 else 0
  3.   xright=1 if c.x<self.size - 1 else 0
  4.   yleft=-1 if c.y>0 else 0
  5.   yright=1 if c.y<self.size - 1 else 0
  6.   c.isOpened = True
  7.   if c.value ==0:
  8.     цикл по xshift от xleft до xright
  9.       цикл по yshift от yleft до yright
  10.         target=self[c.x+xshift][c.y+yshift]
  11.         target.isOpened=True
  12.         if target.value==0:
  13.           openAroundZero(target)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement