def r(self): temp = dc(self) self.r_layer = np.rot90(temp.r_layer, 3) self.f_layer[:, 2] = temp.d_layer[:, 2] self.d_layer[:, 2] = temp.b_layer[:, 0][::-1] self.b_layer[:, 0] = temp.u_layer[:, 2][::-1] self.u_layer[:, 2] = temp.f_layer[:, 2] return self
def l_pr(self): temp = dc(self) self.l_layer = np.rot90(temp.l_layer, 1) self.f_layer[:, 0] = temp.d_layer[:, 0] self.d_layer[:, 0] = temp.b_layer[:, 2][::-1] self.b_layer[:, 2] = temp.u_layer[:, 0][::-1] self.u_layer[:, 0] = temp.f_layer[:, 0] return self
def d_pr(self): temp = dc(self) self.d_layer = np.rot90(temp.d_layer, 1) self.f_layer[2, :] = temp.r_layer[2, :] self.r_layer[2, :] = temp.b_layer[2, :] self.b_layer[2, :] = temp.l_layer[2, :] self.l_layer[2, :] = temp.f_layer[2, :] return self
def u_pr(self): temp = dc(self) self.u_layer = np.rot90(temp.u_layer, 1) self.f_layer[0, :] = temp.l_layer[0, :] self.l_layer[0, :] = temp.b_layer[0, :] self.b_layer[0, :] = temp.r_layer[0, :] self.r_layer[0, :] = temp.f_layer[0, :] return self
def b_pr(self): temp = dc(self) self.b_layer = np.rot90(temp.b_layer, 1) self.u_layer[0, :] = temp.l_layer[:, 0][::-1] self.l_layer[:, 0] = temp.d_layer[2, :] self.d_layer[2, :] = temp.r_layer[:, 2][::-1] self.r_layer[:, 2] = temp.u_layer[0, :] return self
def f(self): temp = dc(self) self.f_layer = np.rot90(temp.f_layer, 3) self.u_layer[2, :] = temp.l_layer[:, 2][::-1] self.l_layer[:, 2] = temp.d_layer[0, :] self.d_layer[0, :] = temp.r_layer[:, 0][::-1] self.r_layer[:, 0] = temp.u_layer[2, :] return self
# liste = [cube.u_layer,cube.f_layer,cube.l_layer,cube.b_layer,cube.r_layer,cube.d_layer] # final = [] # for i in liste: # final.append(test(i)) # if False in final: # return False # else: # return True """ ################################################################## ############################## MAIN ############################## ################################################################## """ rubix = cube() solved = dc(rubix) #register(rubix.u_layer,0) #register(rubix.f_layer,1) #register(rubix.l_layer,2) #register(rubix.b_layer,3) #register(rubix.r_layer,4) #register(rubix.d_layer,5) scramble = [] rubix.scramble(10, scramble) #print(rubix) """ ################################ Fun part ############################## """