| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
structure.sage_object.SageObject --+
|
RubiksCube
sage: C = RubiksCube().move("R U R'")
sage: C.show3d()
sage: C = RubiksCube("R*L"); C
+--------------+
| 17 2 38 |
| 20 top 36 |
| 22 7 33 |
+------------+--------------+-------------+------------+
| 11 13 16 | 41 18 3 | 27 29 32 | 48 34 6 |
| 10 left 15 | 44 front 5 | 26 right 31 | 45 rear 4 |
| 9 12 14 | 46 23 8 | 25 28 30 | 43 39 1 |
+------------+--------------+-------------+------------+
| 40 42 19 |
| 37 bottom 21 |
| 35 47 24 |
+--------------+
sage: C.show()
sage: C.solve(algorithm='gap') # long time
'L R'
sage: C == RubiksCube("L*R")
True
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
File: sage/structure/sage_object.pyx (starting at line 86)
|
File: sage/structure/sage_object.pyx (starting at line 95)
|
sage: C = RubiksCube().move("R*U")
sage: C.plot3d()
sage: C.plot()
|
Algorithm must be one of :
hybrid - try kociemba for timeout seconds, then dietz
kociemba - Use Dik T. Winter's program (reasonable speed, few moves)
dietz - Use Eric Dietz's cubex program (fast but lots of moves)
optimal - Use Michael Reid's optimal program (may take a long time)
gap - Use GAP word solution (can be slow)
EXAMPLE:
sage: C = RubiksCube("R U F L B D")
sage: C.solve()
'R U F L B D'
Dietz's program is much faster, but may give highly non-optimal solutions.
sage: s = C.solve('dietz'); s
"U' L' L' U L U' L U D L L D' L' D L' D' L D L' U' L D' L' U L' B' U' L' U B L D L D' U' L' U L B L B' L' U L U' L' F' L' F L' F L F' L' D' L' D D L D' B L B' L B' L B F' L F F B' L F' B D' D' L D B' B' L' D' B U' U' L' B' D' F' F' L D F'"
sage: C2 = RubiksCube(s)
sage: C == C2
True
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:41 2008 | http://epydoc.sourceforge.net |