hcube-0.1.1: Virtual Rubik's cube of arbitrary size.

Safe HaskellSafe



Orientation group is used to represent orientation of cubies, and cube as a whole.



class Monoid a => Group a whereSource

Logical extension of Monoid to a group.


inv :: a -> aSource


data Orient Source

Representation of Cubie orientation.


Orient [Vec] 

cons :: Char -> OrientSource

Constructs an element of the orientation group from the name.

to :: Orient -> MatrixSource

Maps an element of the orientation group to a matrix. Orient tranformation matrix is determined by specifing, (1,0,0) goes to v1 and (0,1,0) goes to v2.

eid :: Orient -> CharSource

Gives the name of an element of the orientation group.

getVec :: Orient -> [Vec]Source

Two vector representation of orientation.

vecToSide :: Vec -> SideSource

Inverse of sideToVec.

sideToVec :: Side -> VecSource

Associates a side to a vector.

rawToOrientNumber :: Numb -> NumbSource

Raw number is an intermediate step in associating two vectors to an orientation. The orientation number 1 corresponds to an orientation of ''a'' and so on.

orientNumberToRaw :: Numb -> NumbSource

Inverse of rawToOrientNumber

rawOrientNum :: Orient -> NumbSource

Converts the orientation to the raw orientation number.

spanDomain :: (Enum a, Num a, Ord b) => (Orient -> b) -> [(a, b)]Source

Maps a function of orientation over orient domain.

vecToColor :: Vec -> ColorSource

Inverse of colorToVec.

colorToVec :: Color -> VecSource

Gives the color of the side identified by the vector, in a solved state.

orientChrDomain :: [Char]Source

List of names for elements of the orientation group.