Skip to content

Commit

Permalink
Add execute() method to CubieCube
Browse files Browse the repository at this point in the history
  • Loading branch information
ansiwen committed Dec 29, 2015
1 parent 18c34d2 commit 2e6a519
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kociemba/pykociemba/cubiecube.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def getURtoDF(idx1, idx2):
class CubieCube(object):
"""Cube on the cubie level"""

__s_to_ax = {"U": 0, "R": 1, "F": 2, "D": 3, "L": 4, "B": 5}
__s_to_po = {"": 1, "2": 2, "'": 3}

# initialize to Id-Cube

def __init__(self, cp=None, co=None, ep=None, eo=None):
Expand Down Expand Up @@ -90,6 +93,13 @@ def toFaceCube(self):
fcRet.f[_butya] = FaceCube.edgeColor[self.ep[i]][n]
return fcRet

def execute(self, maneuver):
for move in maneuver.split():
ax = self.__s_to_ax[move[0]]
po = self.__s_to_po[move[1:]]
for i in range(po):
self.multiply(moveCube[ax])

def cornerMultiply(self, b):
"""
Multiply this CubieCube with another cubiecube b, restricted to the corners.<br>
Expand Down

0 comments on commit 2e6a519

Please sign in to comment.