All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Devilish Cubes (Posted on 2009-07-27)
I once was presented with a set of 4 cubes each having a different net configuration.

The object was to place the cubes in a line such that no face within any of the four rectangles so formed contained the same colour within that rectangle.
Then too, no colour was orthogonally adjacent to a face of the same colour in an adjoining rectangle.
Lastly the end faces of the composite prism were both different to each other and not repeated within the rectangular faces.

 A B C D 4 2 1 6 3 3 3 3 5 2 3 1 4 6 4 2 2 2 4 4 4 5 5 5 j k l m A A A A A A Caution: This is not an on-line interactive presentation.

The table above shows a set of cubic nets. Replace j, k, l & m with an appropriate label A, B, C or D to indicate the net used.

Additionally add just one digit to each cell in compliance with those nets so that each row along with the end values contains unique values.

 See The Solution Submitted by brianjn Rating: 2.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2

There seem to be 24 basic solutions, barring trivial variations.

In the below table of the 24, cube A is always shown in the second column (column k), but could be exchanged with the cube to its right (column l) as the left and right faces are hidden. Also the visible faces of the entire set could be rotated 1, 2 or 3 positions. Also, the entire structure could be flipped left and right, as cube A is always presented in the sequence 2543, rather than the 3452 it would take upon this flipping. Thus each solution presented would have 4*2*2-1 = 15 trivial variations.

` BADC    DACB    DABC    BADC    DACB    DABC    CABD    CABD    BADC    DACB642531  652341  652431  642351  632541  632451  132456  152436  632451  642531 3542    4523    4532    3524    2543    2534    4532    2534    2534    3542 2435    3452    3425    2453    5432    5423    5423    3425    5423    2435 5324    2345    2354    5342    4325    4352    2354    4352    4352    5324`
` `
` DABC    BADC    DACB    DABC    BADC    DACB    DABC    BADC    DACB    DABC642351  632541  652431  652341  652431  642351  642531  652341  632451  632541 3524    2543    4532    4523    4532    3524    3542    4523    2534    2543 2453    5432    3425    3452    3425    2453    2435    3452    5423    5432 5342    4325    2354    2345    2354    5342    5324    2345    4352    4325`
` `
` BACD    CADB    BACD    CADB152436  132456  132456  152436 2534    4532    4532    2534 3425    5423    5423    3425 4352    2354    2354    4352  `

The program assumes that 6 and 1 are the end colors as these are not present on cube A.

DECLARE FUNCTION orient\$ (cube!, orientation!)
DATA 233445,436251,232154,434652

DIM SHARED c\$(4)

CLS

FOR cube = 1 TO 4
NEXT

FOR o1 = 0 TO 11 STEP 4 ' reduced to eliminate trivial variations
cb\$(1) = orient\$(1, o1)
FOR o2 = 0 TO 23
cb\$(2) = orient\$(2, o2)
FOR o3 = 0 TO 23
cb\$(3) = orient\$(3, o3)
FOR o4 = 0 TO 23
cb\$(4) = orient\$(4, o4)

good = 1
REDIM col(6): colUsed = 0
FOR i = 1 TO 4
s\$(i) = ""
FOR j = 1 TO 4
IF INSTR(s\$(i), MID\$(cb\$(j), i, 1)) > 0 THEN good = 0: EXIT FOR
s\$(i) = s\$(i) + MID\$(cb\$(j), i, 1)
IF i > 1 THEN
IF RIGHT\$(s\$(i), 1) = MID\$(s\$(i - 1), j, 1) THEN good = 0: EXIT FOR
IF i = 4 THEN
IF RIGHT\$(s\$(i), 1) = MID\$(s\$(1), j, 1) THEN good = 0: EXIT FOR
END IF
END IF
cNum = VAL(MID\$(cb\$(j), i, 1))
IF col(cNum) = 0 THEN
col(cNum) = 1
colUsed = colUsed + 1
IF colUsed > 4 THEN good = 0: EXIT FOR
END IF
NEXT
IF good = 0 THEN EXIT FOR
NEXT
IF good THEN
FOR e1 = 2 TO 4
FOR e2 = 2 TO 4
IF e1 <> e2 THEN
IF MID\$(cb\$(e1), 5, 1) = "6" AND MID\$(cb\$(e2), 6, 1) = "1" OR MID\$(cb\$(e1), 5, 1) = "1" AND MID\$(cb\$(e2), 6, 1) = "6" THEN
n2 = 9 - e1 - e2
c0 = (solCt MOD 10) * 8 + 1
r0 = (solCt \ 10) * 8 + 1
LOCATE r0, c0 + 1
PRINT MID\$("ABCD", e1, 1) + MID\$("ABCD", 1, 1) + MID\$("ABCD", n2, 1) + MID\$("ABCD", e2, 1);
LOCATE r0 + 1, c0
PRINT MID\$(cb\$(e1), 5, 1) + MID\$(cb\$(e1), 1, 1) + MID\$(cb\$(1), 1, 1) + MID\$(cb\$(n2), 1, 1) + MID\$(cb\$(e2), 1, 1) + MID\$(cb\$(e2), 6, 1);
LOCATE r0 + 2, c0 + 1
PRINT MID\$(cb\$(e1), 2, 1) + MID\$(cb\$(1), 2, 1) + MID\$(cb\$(n2), 2, 1) + MID\$(cb\$(e2), 2, 1);
LOCATE r0 + 3, c0 + 1
PRINT MID\$(cb\$(e1), 3, 1) + MID\$(cb\$(1), 3, 1) + MID\$(cb\$(n2), 3, 1) + MID\$(cb\$(e2), 3, 1);
LOCATE r0 + 4, c0 + 1
PRINT MID\$(cb\$(e1), 4, 1) + MID\$(cb\$(1), 4, 1) + MID\$(cb\$(n2), 4, 1) + MID\$(cb\$(e2), 4, 1);
solCt = solCt + 1
END IF
END IF
NEXT
NEXT

END IF

NEXT
NEXT
NEXT
NEXT

FUNCTION orient\$ (cube, orientation)
cu\$ = c\$(cube)
e1 = orientation \ 4 + 1
e2 = orientation \ 4 + 4: IF e2 > 6 THEN e2 = e2 - 6
SELECT CASE e1
CASE 1
seq\$ = "2356"
CASE 2
seq\$ = "1643"
CASE 3
seq\$ = "1245"
CASE 4
seq\$ = "2653"
CASE 5
seq\$ = "1346"
CASE 6
seq\$ = "1542"
END SELECT
rot = orientation MOD 4
s\$ = MID\$(seq\$, rot + 1) + LEFT\$(seq\$, rot)
o\$ = ""
FOR i = 1 TO 4
o\$ = o\$ + MID\$(cu\$, VAL(MID\$(s\$, i, 1)), 1)
NEXT
o\$ = o\$ + MID\$(cu\$, e1, 1) + MID\$(cu\$, e2, 1)
orient\$ = o\$
END FUNCTION

Note the orientations for cube 1 (cube A) are limited to every fourth one to eliminate rotations from the basic orientation and to under 12  so that only the faces with the 2 or one of the 3's can face the left end cap.

 Posted by Charlie on 2009-07-27 16:28:53

 Search: Search body:
Forums (0)