3D Cube Game

The setting of this game is on a rectangular prism of dimension 101x100x99. This prism is made entirely out of unit cubes. The game starts with the bottom, front, right cube selected. There are two players and they take turns selecting cubes. Which ever player selects the top, back, left cube loses.

On their turn, a player may select any cube that is vertex adjacent to the currently selected cube and does not move away in any direction from the the top, back, left cube. Visually, imagine a 2x2x2 cube made up of 8 unit cubes with the currently selected cube is in the bottom, front, right position. Then the other 7 cubes are legal moves (so long as they exist on the larger prism). After making a move, the next player starts from where the previous player moved to.

Would you rather start first or second?

just to be consistent can we make the setting an overcrowded prison and whichever prisoner wins gets out?

1 Like

I will just assume this is the case

Summary

Our prisoner wants to go first. I will illustrate this on a 7×6×5 board as it will become apparent that the only thing that really matters is whether these dimensions are even or odd.

Our upper most layer looks like this:


The skull represents the cube we don’t want to take, green is a winning state, red is a losing state. It’s quite clear that on a larger board this layer would continue to alternate columns and rows in each direction.

The second to top layer looks like this:


As no matter where you are, save for right above the final square, you can always move to a losing state. Again this clearly just continues in each direction.

The third to top layer looks like this:


Again we get an alternating pattern.

The fourth to top layer looks like:


and thus we loop in the vertical direction too. We see that our front, bottom, left cube is always a winner so we want to go first to escape this convoluted prison.

1 Like

I might be confused, but if you picked A6 or B7 on the top layer wouldn’t the next prisoner have to take the skull and you win?

Yeah so what I meant was if that box is selected when your turn starts you lose. Similarly a check mark means if it’s selected when your turn starts you win. So a check mark basically means you can select an x while an x means you have to select a check mark putting your opponent in a winning position.

then wouldn’t going first be bad? Because you have to select a check, and then your opposing prisoner going second gets the chance to select an x?

The first cube starts selected and is a ✓, so you get to choose the next cube which is a losing square.

Summary

In the given example imagine you start on the lowest image F-1. Your turn to choose so you move up a layer and select E-1 as this is an x. It’s your opponents turn, they have no choice now but to pick a ✓ (assuming I drew this right). Whatever ✓ they pick you can put them on an x

Nice, that looks right to me. So what’s the general rule for going first/second based dimensions (x,y,z)?

Another way to look at it and also solves my generation to n-dimensions I mentioned in Ethan’s version of the problem

Summary

Represent the game as an n-dimensional array of natural numbers greater than 1 and say the person who moves onto the array of all 1s loses. Call a dimension closed out when it is equal to 1.

In general if there is at least one even dimension in the array, the player starting will win. From this starting position, the player can move onto an array of all odd dimensions.

The exception is when closing out to the last dimension (multiple dimensions may be closed at once) but the single non closed dimension should be set to even. The game is completely fixed at this point

Since the first player is always moving to all odd dimension the other will never be able to close a dimension (specifically closing out the last dimension). You can also see if the condition of the game is flipped such that moving onto all 1s is a win the same rule holds. The first play just always moves to all odd even when closing the last dimension.

oh my issue was I was thinking going first meant that the first prisoner automatically selects that first bottom front right cube, and the second prisoner goes from there and that’s the second choice. But it makes more sense that the first cube is just a starting position, not the first selection.