See Cube.solved
See Cube.view
Check out the example on Github to see how the different functions interact with each other
This representation of how the cube looks is meant for advanced custom use if you for some reason want to display the cube differently than this package does, or you need to introspect specific state of the cube for some application.
It is expected that most use cases should be able to fulfill your goals without the use of this, and if you find a use case that you think should be covered by the package itself feel free to submit a Github issue.
Otherwise as mentioned use these rendering methods and types to accomplish all the custom goals you want to!
The rendering of one specific cubie (a cubie is one of the pieces of the Rubik's Cube). Note that we describe all sides of all cubies in this model, even the ones that aren't facing outwards.
The color of a face of a cubie. The name of the color corresponds to the face of the cube that it belongs to in the initial orientation. So in standard scrambling orientation of the 3x3 cube UpColor is white and RightColor is red. PlasticColor means it is a part of the cubie not facing outwards
Describes all the possible faces of a cubie (a piece on the cube)
A helper type that allows us to make it impossible to represent impossible locations on the cube. By splitting the faces into opposites like we've done with these 3 types we can describe that a corner location is exactly described by one of each of three opposing faces, and not any two faces, and similarly for edges
Same as UOrD
Same as UOrD
Get the color corresponding to the given face
Set the given color on the given face of the given cubie rendering
Describes all the possible locations of a corner on a cube
Get the corner at the given location of the given cube
Set the given corner at the given corner location on the given cube
All possible corner locations
import List.Nonempty
List.Nonempty.length cornerLocations --> 8Describes all the possible locations of an edge on a cube
Get the edge at the given location on the given cube
Set the given edge at the given location of the given cube
All possible edge locations
import List.Nonempty
List.Nonempty.length edgeLocations --> 12Describes all the possible locations of a center on a cube
Get the center at the given location on the given cube
Set the given center at the given location on the given cube
All possible center locations
import List.Nonempty
List.Nonempty.length centerLocations --> 6
See Cube