Skip to content

Added Basic Framework of Cube #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Added Basic Framework of Cube #6

wants to merge 3 commits into from

Conversation

amanpalariya
Copy link

@amanpalariya amanpalariya commented Dec 11, 2019

solver.py contains two classes - Cube and Rotations. Cube class stores and handles cube rotations and should contain a method get_solution by the end of the project. Rotations class contain the standard moves of a cube and some functions.

Please go through the file and understand how it works

Basic way to use this framework

from solver import Cube, Rotations

#The matrix should have shape [6, 3, 3] and can contain anything object
#Go through the image cube_net.png to understand the matrix
c = Cube(matrix) 

#Printing the net of the cube
print(c.get_string_net()) 

#This is called the sexy move by speedcubers (R U R' U')
algo = Rotations.R + Rotations.U + Rotations.R_prime + Rotations.U_prime 

#Applies the given algorithm
c.apply_algorithm(algo) 

c.print(c.get_string_net())

Algorithms can also be created as given below
algo = Rotations.algorithm_from_string("R U R' U'")

DO NOT USE NumPy TO STORE ARRAYS
If NumPy is used, swapping will fail leading to failure of rotate function

solver.py contains two classes "Cube" and "Rotations". Cube class stores and handles cube rotations and should contain a method "solve" by the end of the project. Rotations class contain the moves of a cube and some functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant