Question: I am currently building Rubik's Cube program using Python. The cube is supposed to be represented by an array of 54 elements. The initial cube

I am currently building Rubik's Cube program using Python. The cube is supposed to be represented by an array of 54 elements. The initial cube array looks like this:

cube = [f,f,f,f,f,f,f,f,f,r,r,r,r,r,r,r,r,r,b,b,b,b,b,b,b,b,b,l,l,l,l,l,l,l,l,l,t,t,t,t,t,t,t,t,t,u,u,u,u,u,u,u,u,u]

I am currently building Rubik's Cube program using Python. The cube is

Our program is supposed to check a cube array to make sure it's a legal representation of a cube. Apparently, the below cube arrays are illegal because of edge conflicts, but I don't know what this means:

illegalCube1 = [f,f,f,t,f,f,f,f,f,r,r,r,r,r,r,r,r,r,b,u,b,b,b,b,b,b,b,l,l,l,l,l,l,l,l,l,t,t,t,f,t,t,t,t,t,u,u,u,b,u,u,u,u,u]

illegalCube2 = [f,f,f,f,f,f,f,f,f,r,r,r,r,r,l,r,l,r,b,b,b,b,b,b,b,b,b,l,l,l,r,l,r,l,l,l,t,t,t,u,t,t,t,t,t,u,t,u,u,u,u,u,u,u]

Why are the given illegalCube arrays illegal? What is an edge conflict?

top-1 top-2 top-3 back-1 back-2 back-3 right-3 top-4 top-5 top-6 back-4 back-5 back-6 right-2 right-6 top-7 top-8 top-9 back-7 back-8 back-9 right-1 right-5 right-9 left-1 left-2 left-3 front-1 front-2 front-3 right-4 right-8 left-4 left-5 left-6 front-4 front-5 front-6 right-7 left-7 left-8 left-9 front-7 front-8 front-9 under-1 under-2 under-3 under-4 under-5 under-6 under-7 under-8 under-9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!