Face.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:python-rubik 作者: Wiston999 项目源码 文件源码
def __init__(self, size=3, init=None, check=True):
        self.size = size

        if init:
            init = init.replace(' ', '')
            if check and not isinstance(init, (str, basestring)):
                raise ValueError("Init configuration must be a string")

            if check and int(math.sqrt(len(init))) != math.sqrt(len(init)):
                raise ValueError(
                    "Init configuration length must be a power of 2")

            self.size = int(math.sqrt(self.size))
            self.squares = init
        else:
            self.squares = '.' * (self.size * self.size)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号