twentyseven-0.0.0: Rubik's cube solver

Safe HaskellNone
LanguageHaskell2010

Rubik.Cube.Moves.Internal

Contents

Synopsis

Documentation

newtype MoveTag m a Source

Constructors

MoveTag 

Fields

unMoveTag :: a
 

Instances

Functor (MoveTag m) Source 
Eq a => Eq (MoveTag m a) Source 
Ord a => Ord (MoveTag m a) Source 
Show a => Show (MoveTag m a) Source 
NFData a => NFData (MoveTag m a) Source 
Binary a => Binary (MoveTag m a) Source 
Newtype (MoveTag m a) a Source 

move18Names :: MoveTag Move18 [ElemMove] Source

Associate every elementary move with an ElemMove.

l :: Cube Source

Left

f :: Cube Source

Front

r :: Cube Source

Right

b :: Cube Source

Back

d :: Cube Source

Down

move6 :: [Cube] Source

List of the 6 generating moves.

move6 = [u,l,f,r,b,d]

move18 :: MoveTag Move18 [Cube] Source

List of the 18 elementary moves.

move18 = [u, u <>^ 2, u <>^ 3, ...]

move6' :: [Cube] Source

Generating set of G1

move10 :: MoveTag Move10 [Cube] Source

G1 = <U, D, L2, F2, R2, B2>

surf3 :: Cube Source

Rotation of the whole cube around the diagonal axis through corners URF and LBD

sf2 :: Cube Source

Half-turn of the whole cube around the FB axis

su4 :: Cube Source

Quarter-turn around the UD axis

slr2 :: Cube Source

Reflection w.r.t. the RL slice plane

newtype SymCode s Source

Index of a symmetry

Constructors

SymCode 

Fields

unSymCode :: Int
 

Instances

data Symmetry sym Source

Constructors

Symmetry 

Fields

symAsCube :: Cube
 
symAsMovePerm :: [Int]
 

data Symmetric sym a Source

rawMoveSym :: Symmetry sym -> [a] -> [a] Source

symDecode :: SymCode s -> Cube Source

Translate an integer to a symmetry.

data CubeSyms Source

Octahedral group

sym16Codes :: [SymCode UDFix] Source

Symmetries which preserve the UD axis (generated by sf2, su4 and slr2)

sym48Codes :: [SymCode CubeSyms] Source

All symmetries of the whole cube

composeSym :: SymCode sym -> SymCode sym -> SymCode sym Source

type ElemMove = (Int, BasicMove) Source

Quarter turns, clock- and anti-clockwise, half turns

type Move = [ElemMove] Source

Moves generated by BasicMove, group-ed

consMove :: ElemMove -> Move -> Move infixr 5 Source

oppositeAndGT :: BasicMove -> BasicMove -> Bool Source

Relation between faces

oppositeAndGT X Y == True if X and Y are opposite faces and X > Y.

reduceMove :: Move -> Move Source

Perform "trivial" reductions of the move sequence.

moveToCube :: Move -> Cube Source

Scramble the solved cube.

moveToString :: Move -> String Source

Show the move sequence.

decodeMove :: Char -> Maybe BasicMove Source

Associates s character in ULFRBD or the same in lowercase to a generating move.

stringToMove :: String -> Either Char Move Source

Reads a space-free sequence of moves. If the string is incorrectly formatted, the first wrong character is returned.

([ulfrbd][23']?)*

nubMove :: [Move] -> [Move] Source

Remove moves that result in duplicate actions on the Rubik's cube

Random cube

coordToCube :: RawCoord CornerPermu -> RawCoord CornerOrien -> RawCoord EdgePermu -> RawCoord EdgeOrien -> Cube Source

Decode a whole Cube from coordinates.

randomCube :: MonadRandom m => m Cube Source

Generate a random solvable Cube.

Relies on randomRIO.