Example #1
0
    def verify(self, s):
        """ generated source for method verify """
        count = [None] * 6
        try:
            i = 0
            while i < 54:
                count[Color.valueOf(s.substring(i, i + 1)).ordinal()] += 1
                i += 1
        except:
            return -1

        i = 0
        while i < 6:
            if count[i] != 9:
                return -1
            i += 1
        fc = FaceCube(s)
        cc = fc.toCubieCube()
        return cc.verify()
Example #2
0
 def toFaceCube(self):
     """ generated source for method toFaceCube """
     fcRet = FaceCube()
     print fcRet.cornerFacelet
     n = 0
     for c in Corner:
         i = c
         j = self.cp[i]
         ori = self.co[i]
         while n < 3:
             face = fcRet.cornerFacelet[i] = (n + ori) % 3
             fcRet.f[face] = fcRet.cornerColor[j][n]
             n += 1
     n = 0
     for e in Edge:
         i = e
         j = self.ep[i]
         ori = self.eo[i]
         while n < 2:
             face = fcRet.edgeFacelet[i] = (n + ori) % 2
             fcRet.f[face] = fcRet.edgeColor[j][n]
             n += 1
     return fcRet