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

Portability portable provisional echbar137@yahoo.co.in Safe

HCube.Lib

Description

Exposes virtual cube functionality.

Synopsis

Documentation

data Rubik Source

Vitrual Rubik's cube.

Constructors

 Rubik Fieldsn :: Size crn :: [Cube] edg :: [Cube] cnt :: [Cube] hid :: [Cube] loop :: Bool view :: View his :: [Rotation]

Instances

 Eq Rubik Read Rubik Show Rubik

data Cube Source

Individual cube of Rubik's cube, known as a Cubie.

Constructors

 Cube Fieldspos :: Vec ori :: Orient cid :: Numb

Instances

 Eq Cube Read Cube Show Cube

posToId :: Size -> Vec -> NumbSource

Converts a pseudo-vector representation to a cube id.

getPos :: Size -> Numb -> VecSource

Converts a cube id to a pseudo-vector representation.

consCubeInfo :: Int -> CubeSurf -> [(Int, ActualCube, ColorTag)]Source

Converts from a surface view of cube to a cubie view of cube.

CubeSurf representing a solved cube.

cubeIdsOfFace :: Int -> Side -> [Int]Source

Maps a face id defined with respect to a side, to the cube id.

cubeTypes :: Size -> ([Int], [Int], [Int], [Int])Source

Generates a tuple of cube ids corresponding to (corners, edges, centers, hidden cubies).

Creates a virtual cube in solved state

getFaceColor :: Rubik -> (Numb, Side) -> StringSource

Color of cube id on a face is returned. This function is important for rendering.

Returns the cubie at a given position.

doCubeOps :: [Rotation] -> Rubik -> RubikSource

Performs a cube operation on virtual cube. Conceptually this corresponds to multiplying the cube state by an appropriate element of the permutation group. However a vector approach is used here.