sp2
来源:互联网 发布:有趣的品牌 知乎 编辑:程序博客网 时间:2024/05/22 09:03
class Box:
def __init__(self,x,y,width=BOXWIDTH,height=BOXHEIGHT,image=None):
self.x = x
self.y = y
self.width = width
self.height = height
self.image = image
self.surf = Surface((self.width,self.height))
self.surf_cover = Surface((self.width,self.height))
self.color = BOXCOLOR
self.surf.fill(self.color)
self.surf_cover.fill(COVERCOLOR)
self.is_revealed = False
self.cover_color = COVERCOLOR
self.boxx = 0
self.boxy = 0
self.is_blank = False
self.num = 0
def set_cord(self,x,y):
self.x = x
self.y = y
def set_image(self,image):
self.image = image
def set_surf(self,surf):
self.surf = surf
def set_surf_color(self,color):
self.surf.fill(color)
def can_move(self):
global BLANK
print "BLANK:",BLANK,self.boxx,self.boxy
if self.boxx == BLANK[0] + 1 and self.boxy == BLANK[1]:
return LEFT
elif self.boxx == BLANK[0] - 1 and self.boxy == BLANK[1]:
return RIGHT
elif self.boxx == BLANK[0] and self.boxy == BLANK[1] - 1:
return DOWN
elif self.boxx == BLANK[0] and self.boxy == BLANK[1] + 1:
return UP
else:
return False
def move_to(self,move):
global BLANK
self.is_blank = True
BLANK = (self.boxx,self.boxy)
def __init__(self,x,y,width=BOXWIDTH,height=BOXHEIGHT,image=None):
self.x = x
self.y = y
self.width = width
self.height = height
self.image = image
self.surf = Surface((self.width,self.height))
self.surf_cover = Surface((self.width,self.height))
self.color = BOXCOLOR
self.surf.fill(self.color)
self.surf_cover.fill(COVERCOLOR)
self.is_revealed = False
self.cover_color = COVERCOLOR
self.boxx = 0
self.boxy = 0
self.is_blank = False
self.num = 0
def set_cord(self,x,y):
self.x = x
self.y = y
def set_image(self,image):
self.image = image
def set_surf(self,surf):
self.surf = surf
def set_surf_color(self,color):
self.surf.fill(color)
def can_move(self):
global BLANK
print "BLANK:",BLANK,self.boxx,self.boxy
if self.boxx == BLANK[0] + 1 and self.boxy == BLANK[1]:
return LEFT
elif self.boxx == BLANK[0] - 1 and self.boxy == BLANK[1]:
return RIGHT
elif self.boxx == BLANK[0] and self.boxy == BLANK[1] - 1:
return DOWN
elif self.boxx == BLANK[0] and self.boxy == BLANK[1] + 1:
return UP
else:
return False
def move_to(self,move):
global BLANK
self.is_blank = True
BLANK = (self.boxx,self.boxy)
- sp2
- sp2
- sp2->sp3
- SP2结束
- SP2-0618
- SP2-0618、SP2-0611 PLUSTRCE授权错误
- winXP SP2体验
- DVBBS sp2 漏洞
- SP2中的网页乱码
- 万能GHOST SP2教程
- sp2的防火墙
- 終於裝上了WINDOWS2003 SP2
- 进入SP2.0时代
- XP SP2激活总集
- 破解xp(sp2)密码
- SQL 2005 SP2安裝失敗
- TestDirector 8.2 SP2安装
- windows2003 sp2 拒绝访问
- C++string类常用函数
- doc、xls 等 office 2002 之类的格式有 MIME
- <imput>的一些限制输入方法
- android.os.NetworkOnMainThreadException
- sp1
- sp2
- sp3
- 对你职业生涯帮助最大的习惯是什么?它是如何帮助你的?
- time.h
- sp4
- 编译QT4.5 X86版本错误
- vmware win7双机调试
- POJ 3624 01背包问题
- POJ 3067 - Japan