Open scottbedard opened 5 years ago
To help visualize how the spirals will map to different size faces, I whipped up some quick desmos constructions. We'll need to create a function that can take these spirals and chunk them into their individual rings.
One important thing to note here is that there is a slight difference between our even and odd layered puzzles. The ring logic should be the same, with an exception of odd layered puzzles starting with center piece.
Update: The chunk function is written, click here to see the spec.
Now that we have the ability to rotate pentagonal faces, it's time to work out the relationships between faces. In order to know how the other faces are effected by a turn, we'll need to use our orientation and relationship with other faces to extract and move around these kinds of rings.
At a minimum we'll need the following things...
Working on this more, here is a larger map of the even-layer minx spiral
To give some context to our slice function, here is an example slice with a depth of three on this map.
2, 3, 10, 15, 28, 37, 56, 69
Here is the same sort of map for odd-layered minx puzzles
The primary function of this library will be to manage the state of any size N-minx puzzle, where the number of layers is greater than 1. We can't quite piggy back off how this works in our cube repo, because unlike cubes we cannot represent each face as a simple two dimensional table. We'll be dealing with the following types of faces...
The simplest way I can think of to store this data is to think of each face as having a specific orientation, and storing each sticker value spiraling outward from the center. For example, a megaminx (3 layer) style puzzle might look something like this...
Each face will have a unique identifier and orientation. On first thought, something like this might work.
The sticker index will begin in the center of the face, and spiral clockwise outward starting with the corner opposite that faces orientation. For example, the
F
face on a standard gigaminx would have the following index positions. We start from this position because it will always be a corner, which puzzles of any size are guaranteed to have.Using this spiral, we can extract "rings" from our faces, which can then by sliced to get a particular intersection. To build off the example above, this face would have the following rings of index positions.