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

Home > Games
Minus Cube (Posted on 2013-04-18) Difficulty: 3 of 5
This is my representation of the Minus Cube

Consider a 2 unit cube being composed of 8 unit cubes but with one removed. The blue circles are the centres of where the unit cubes may be placed. The unlabelled circle is the centre of the unoccupied space.

Number .
original display.


Any cube that is horizontally or vertically adjacent to the void (ie, connected by a straight line) may be moved into it (ignore gravity).

Your task is to report on three challenges:
1. The least number of moves to return the left graphic to that shown on the right, the "home" position.

After setting the HOME position:
2. The least number of moves to create a reflection of the shown left cube, ie, exchange the 2 with the 4 and the 6 with the void.
3. The least number of moves so that the sums of opposing vertices on the four major diagonals (red) is 9; allow the blank to be 8.

Having played with the interactive, have you found another challenge we could share in Comments?

Note: Please exercise the utmost of care with the interactive as programming does not trap careless entries, so on browser freeze you may need to wait about 30 secs for a pop-up dialog advice.

No Solution Yet Submitted by brianjn    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution parts 2 and 3 | Comment 2 of 3 |

Part 2:

DECLARE SUB makeMove (mno!)
DECLARE FUNCTION checksol! (mno!)
CLEAR , , 25000
OPEN "minus cube 2.txt" FOR OUTPUT AS #2
DIM SHARED cube(1, 1, 1), currx, curry, currz, hist(50), maxmove
maxmove = 19
cube(0, 0, 0) = 6 ' to 0
cube(1, 0, 0) = 7
cube(1, 1, 0) = 3
cube(0, 1, 0) = 2 ' to 4
cube(0, 0, 1) = 5
cube(1, 0, 1) = 0 ' to 6
cube(1, 1, 1) = 4 ' to 2
cube(0, 1, 1) = 1

currx = 1: curry = 0: currz = 1
makeMove 1

FUNCTION checksol (mno)
c = 0
IF currx = 0 AND curry = 0 AND currz = 0 THEN
    IF cube(1, 0, 1) = 6 THEN
        IF cube(1, 0, 0) = 7 THEN
            IF cube(1, 1, 0) = 3 THEN
                IF cube(0, 1, 0) = 4 THEN
                    IF cube(0, 0, 1) = 5 THEN
                        IF cube(1, 1, 1) = 2 THEN
                            IF cube(0, 1, 1) = 1 THEN
                                c = 1
                                FOR i = 1 TO mno
                                    PRINT #2, hist(i);
                                NEXT
                                PRINT #2,
                            END IF
                        END IF
                    END IF
                END IF
            END IF
        END IF
    END IF
END IF
checksol = c
END FUNCTION

SUB makeMove (mno)
' x-axis
tox = 1 - currx
hist(mno) = cube(tox, curry, currz)
IF hist(mno) <> hist(mno - 1) THEN
    SWAP cube(currx, curry, currz), cube(tox, curry, currz)
    prex = currx
    currx = tox
    IF currx = 0 THEN ok = checksol(mno): ELSE ok = 0
    IF ok = 0 AND mno < maxmove THEN
        makeMove mno + 1
    END IF
    currx = prex
    SWAP cube(currx, curry, currz), cube(tox, curry, currz)
END IF

' y-axis
toy = 1 - curry
hist(mno) = cube(currx, toy, currz)
IF hist(mno) <> hist(mno - 1) THEN
    SWAP cube(currx, curry, currz), cube(currx, toy, currz)
    prey = curry
    curry = toy
    IF curry = 0 THEN ok = checksol(mno): ELSE ok = 0
    IF ok = 0 AND mno < maxmove THEN
        makeMove mno + 1
    END IF
    curry = prey
    SWAP cube(currx, curry, currz), cube(currx, toy, currz)
END IF


' z-axis
toz = 1 - currz
hist(mno) = cube(currx, curry, toz)
IF hist(mno) <> hist(mno - 1) THEN
    SWAP cube(currx, curry, currz), cube(currx, curry, toz)
    prez = currz
    currz = toz
    IF currz = 0 THEN ok = checksol(mno): ELSE ok = 0
    IF ok = 0 AND mno < maxmove THEN
        makeMove mno + 1
    END IF
    currz = prez
    SWAP cube(currx, curry, currz), cube(currx, curry, toz)
END IF

END SUB

finding:

 5  1  4  5  1  6  7  3  2  4  5  1  6  5  1  2  3  7
 5  1  4  5  7  3  2  4  1  7  5  2  3  6  7  5  6  7
 5  1  4  3  2  6  7  2  6  4  1  5  2  6  3  2  6  7
 5  1  4  3  2  4  3  2  7  6  4  3  1  5  6  7  3  4
 5  1  4  3  7  6  1  4  2  1  4  5  6  7  3  2  1  4
 5  1  2  3  7  6  3  7  4  2  1  5  6  3  7  4  3  7
 5  1  2  3  7  5  4  2  1  4  5  6  4  5  6  7  3  4
 5  1  2  3  7  5  4  2  1  6  5  4  6  5  4  7  3  4
 5  1  2  3  4  2  3  4  7  6  4  3  1  5  6  7  3  4
 5  1  2  6  7  3  6  2  4  6  2  4  1  5  6  2  3  7
 5  1  2  6  7  3  4  2  1  7  6  4  3  6  7  5  6  7
 5  1  2  6  7  3  4  2  6  4  2  6  1  5  6  2  3  7
 5  6  7  3  2  7  6  1  4  2  3  6  7  4  1  5  6  7
 5  6  7  3  2  1  4  5  6  4  5  2  3  7  4  5  1  4
 5  6  7  3  4  5  6  1  2  4  3  6  5  2  1  5  6  7
 5  6  7  5  6  1  4  6  5  3  2  4  1  5  6  2  3  7
 5  6  7  5  6  1  2  7  5  3  4  2  1  5  7  4  3  7
 5  6  2  1  6  2  7  3  4  6  2  5  6  2  1  4  3  7
 4  1  5  4  7  6  4  7  6  3  2  4  7  5  1  2  3  7
 4  1  5  4  7  3  2  5  4  6  5  4  1  2  3  7  6  5
 4  1  5  6  7  3  1  4  6  5  4  1  2  4  1  2  3  7
 4  1  5  6  7  3  1  4  6  5  2  1  4  2  1  4  3  7
 4  1  5  6  7  4  6  7  4  3  2  4  7  5  1  2  3  7
 4  1  2  3  7  6  5  4  1  2  4  1  6  7  3  4  1  5
 4  3  2  1  5  6  7  4  3  2  4  3  6  5  1  4  3  7
 4  3  7  6  5  4  6  5  4  1  2  4  5  7  3  2  1  5
 4  3  7  6  5  1  3  4  6  7  2  3  4  2  3  4  1  5
 4  3  7  6  5  1  3  4  6  7  4  3  2  4  3  2  1  5
 4  3  7  4  5  1  2  7  4  6  7  4  3  2  1  5  6  7
 4  3  7  4  5  6  4  5  6  1  2  4  5  7  3  2  1  5
 7  6  2  3  6  2  5  1  4  6  2  7  6  2  3  4  1  5
 7  6  5  7  6  3  2  5  7  1  4  2  3  7  5  4  1  5
 7  6  5  7  6  3  4  6  7  1  2  4  3  7  6  2  1  5
 7  6  5  1  4  7  6  3  2  4  1  6  7  2  3  7  6  5
 7  6  5  1  2  3  4  7  6  4  7  2  1  5  4  7  3  4
 7  6  5  1  2  5  6  3  4  2  1  6  5  4  3  7  6  5
 7  3  2  6  5  1  4  2  6  4  2  6  3  7  6  2  1  5
 7  3  2  6  5  1  4  2  3  5  6  4  1  6  5  7  6  5
 7  3  2  6  5  1  6  2  4  6  2  4  3  7  6  2  1  5
 7  3  2  1  4  2  1  4  5  6  4  1  3  7  6  5  1  4
 7  3  2  1  5  7  4  2  3  6  7  4  6  7  4  5  1  4
 7  3  2  1  5  7  4  2  3  4  7  6  4  7  6  5  1  4
 7  3  2  1  5  6  1  5  4  2  3  7  6  1  5  4  1  5
 7  3  4  1  5  6  3  4  2  3  4  7  6  5  1  2  3  4
 7  3  4  1  2  4  1  2  5  6  4  1  3  7  6  5  1  4
 7  3  4  1  2  6  5  2  6  4  3  7  2  6  1  2  6  5
 7  3  4  7  5  1  2  4  3  5  7  2  1  6  5  7  6  5
 7  3  4  7  3  6  5  1  2  4  7  3  6  7  3  2  1  5
 
 (48 ways of going from the Home position to the mirror of the Home position in 18 moves.)
 
Part 3:

Rather than allowing the blank to be 8, and adding to 9, the calculations continue to treat the blank as zero and seek to make opposing corners add to 1 mod 8.  The moves, of course, will the the same no matter which way you look at it.
 
DECLARE SUB makeMove (mno!)
DECLARE FUNCTION checksol! (mno!)
CLEAR , , 25000
OPEN "minus cube 3.txt" FOR OUTPUT AS #2
DIM SHARED cube(1, 1, 1), currx, curry, currz, hist(50), maxmove
maxmove = 10
cube(0, 0, 0) = 6
cube(1, 0, 0) = 7
cube(1, 1, 0) = 3
cube(0, 1, 0) = 2
cube(0, 0, 1) = 5
cube(1, 0, 1) = 0
cube(1, 1, 1) = 4
cube(0, 1, 1) = 1

currx = 1: curry = 0: currz = 1
makeMove 1

FUNCTION checksol (mno)
c = 0
IF (cube(0, 0, 0) + cube(1, 1, 1)) MOD 8 = 1 THEN
    IF (cube(0, 0, 1) + cube(1, 1, 0)) MOD 8 = 1 THEN
        IF (cube(0, 1, 0) + cube(1, 0, 1)) MOD 8 = 1 THEN
            IF (cube(1, 0, 0) + cube(0, 1, 1)) MOD 8 = 1 THEN
                c = 1
                FOR i = 1 TO mno
                    PRINT #2, hist(i);
                NEXT
                PRINT #2,
            END IF
        END IF
    END IF
END IF
checksol = c
END FUNCTION

SUB makeMove (mno)
' x-axis
tox = 1 - currx
hist(mno) = cube(tox, curry, currz)
IF hist(mno) <> hist(mno - 1) THEN
    SWAP cube(currx, curry, currz), cube(tox, curry, currz)
    prex = currx
    currx = tox
    ok = checksol(mno)
    IF ok = 0 AND mno < maxmove THEN
        makeMove mno + 1
    END IF
    currx = prex
    SWAP cube(currx, curry, currz), cube(tox, curry, currz)
END IF

' y-axis
toy = 1 - curry
hist(mno) = cube(currx, toy, currz)
IF hist(mno) <> hist(mno - 1) THEN
    SWAP cube(currx, curry, currz), cube(currx, toy, currz)
    prey = curry
    curry = toy
    ok = checksol(mno)
    IF ok = 0 AND mno < maxmove THEN
        makeMove mno + 1
    END IF
    curry = prey
    SWAP cube(currx, curry, currz), cube(currx, toy, currz)
END IF


' z-axis
toz = 1 - currz
hist(mno) = cube(currx, curry, toz)
IF hist(mno) <> hist(mno - 1) THEN
    SWAP cube(currx, curry, currz), cube(currx, curry, toz)
    prez = currz
    currz = toz
    ok = checksol(mno)
    IF ok = 0 AND mno < maxmove THEN
        makeMove mno + 1
    END IF
    currz = prez
    SWAP cube(currx, curry, currz), cube(currx, curry, toz)
END IF

END SUB

finding

 5  1  4  3  2  6  7  5  3  2
 5  1  4  3  7  6  2  4  3  7
 5  1  2  6  7  3  4  2  6  4
 5  6  7  3  2  1  4  2  3  5
 5  6  7  3  4  1  2  4  3  7
 5  6  2  3  7  5  6  1  4  7
 5  6  2  3  7  5  6  2  5
 5  6  2  1  6  5  7  3  4  7
 4  1  5  6  7  3  2  5  6  7
 4  1  5  6  2  3  7  4  6  2
 4  1  2  3  7  6  5  2  3  5
 4  3  2  6  7  4  3  1  5  7
 4  3  2  6  7  4  3  2  4
 4  3  2  1  3  4  7  6  5  7
 4  3  7  6  2  1  5  2  6  4
 4  3  7  6  5  1  2  5  6  7
 7  6  2  3  4  1  3  2
 7  6  2  3  4  7  5  1  3  4
 7  6  2  3  4  7  6
 7  6  5  7  4  3  2  5  6
 7  6  5  7  4  3  2  1  3  4
 7  6  5  1  4  7  6  5  2  3
 7  6  5  1  2  5  6  7  4  3
 7  3  2  6  5  7  4  1  6  5
 7  3  2  6  5  7  3
 7  3  2  6  5  1  6  2
 7  3  4  1  5  7  3  4  2  6
 7  3  4  1  2  4  3  7  5  6
 7  3  4  7  5  6  2  4  3
 7  3  4  7  5  6  2  1  6  5
 
There are two 7-move solutions shown:


 7  6  2  3  4  7  6
 7  3  2  6  5  7  3


  Posted by Charlie on 2013-04-18 17:51:54
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (12)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information