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

Portabilityportable
Stabilityprovisional
Maintainerechbar137@yahoo.co.in
Safe HaskellSafe

HCube.OrientGroup

Description

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

Synopsis

Documentation

class Monoid a => Group a whereSource

Logical extension of Monoid to a group.

Methods

inv :: a -> aSource

Instances

data Orient Source

Representation of Cubie orientation.

Constructors

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.