Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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]

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions