summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/rubik
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-06 21:58:50 +0000
committerKarl Berry <karl@freefriends.org>2017-03-06 21:58:50 +0000
commitaba00871ee9f5f5ac8d46fe9d0b8e29cd8ce1e8b (patch)
tree98276bb92499bc5ceb7c72cda4393f028520fc4a /Master/texmf-dist/doc/latex/rubik
parent346afec669dbe142884f0794af09981c591e6afd (diff)
rubik (6mar17)
git-svn-id: svn://tug.org/texlive/trunk@43415 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/rubik')
-rw-r--r--Master/texmf-dist/doc/latex/rubik/README.txt88
-rw-r--r--Master/texmf-dist/doc/latex/rubik/Rubik-doc-figB.pdfbin4076 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/Rubik-doc-figF.pdfbin7033 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figD.pdfbin9342 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/examples.pdfbin204366 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/examples.sh5
-rw-r--r--Master/texmf-dist/doc/latex/rubik/examples.tex467
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figA.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubik-doc-figA.pdf)bin3929 -> 3929 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figB.pdfbin0 -> 7192 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figC.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubik-doc-figC.pdf)bin2799 -> 2799 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubik-doc-figD.pdf)bin2908 -> 2908 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figE.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubik-doc-figE.pdf)bin4064 -> 4064 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figF.pdfbin0 -> 7608 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikcube.pdfbin724329 -> 937760 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex7
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexamples.pdfbin0 -> 197642 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexamples.sh9
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexamples.tex1313
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatterns-doc-figA.pdfbin0 -> 9503 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdfbin0 -> 277967 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdfbin0 -> 89246 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh9
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex305
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figA.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figA.pdf)bin1538 -> 1538 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figB.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figB.pdf)bin1856 -> 1856 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figC.pdf (renamed from Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figC.pdf)bin3864 -> 3864 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figD.pdfbin0 -> 10217 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotation.122
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotation.pdfbin372478 -> 420220 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdfbin163436 -> 266913 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotationPL.tex1333
31 files changed, 1707 insertions, 1851 deletions
diff --git a/Master/texmf-dist/doc/latex/rubik/README.txt b/Master/texmf-dist/doc/latex/rubik/README.txt
index 73e4741a858..1874d1938a3 100644
--- a/Master/texmf-dist/doc/latex/rubik/README.txt
+++ b/Master/texmf-dist/doc/latex/rubik/README.txt
@@ -1,62 +1,65 @@
-September 25, 2015
+ March 3, 2017
--------------------------------------------------------------------------
-the RUBIK bundle 2015/09/25
- - rubikcube package v3.0 -> macros and commands for typesetting
- - rubikrotation package v3.0 -> macros and Perl program for rotations
+ The RUBIK bundle 2017/03/03
+ - rubikcube package v4.0 -> macros and commands for typesetting
+ - rubikrotation package v4.0 -> macros and Perl program for rotations
+ - rubikpatterns package v4.0 -> macros and commands for typesetting
--------------------------------------------------------------------------
-The RUBIK bundle provides two complementary packages for documenting the
-Rubik cube (3x3x3) notation, configurations and rotation sequences.
-The two packages are (a) rubikcube package, and (b) rubikrotation package.
+The RUBIK bundle provides three complementary packages for documenting the
+Rubik cube (3x3x3) notation, configurations and for processing rotation sequences.
+The three packages are (a) the rubikcube package, (b) the rubikrotation package,
+and (c) the rubikpatterns package.
(1) Rubikcube package
The rubikcube package provides a collection of LaTeX commands
and macros for typesetting Rubik cube configurations and rotation
instructions using the PGF/TikZ graphic languages.
- This is a stand-alone LaTeX package. However, it is expected to be used in
- conjunction with its complementary rubikrotation package.
-
+
(2) Rubikrotation package
The rubikrotation package, is a dynamic extension to
the rubikcube package. It consists of the Perl script
rubikrotation.pl and style option rubikrotation.sty.
The rubikrotation package implements rotation sequences and
- random scrambling of the Rubik cube on-the-fly using a
- RubikRotation command. It returns the new state in a form
- which is then used for typesetting by the rubikcube package.
+ random scrambling of the Rubik cube on-the-fly, using the
+ RubikRotation command. It returns the new Rubik state in a form
+ which can then be typeset using commands from the rubikcube package.
Since the RubikRotation command works by CALLing the
Perl script rubikrotation.pl, it follows that the rubikrotation
- package requires (a) Perl to be installed, and (b) (Pdf)LaTeX needs
- to be run using the --shell-escape command-line switch.
+ package requires (a) Perl to be installed, and (b) (Pdf/Lua)LaTeX needs
+ to be run using the --shell-escape command-line switch (LuaLaTeX will
+ require access to the recent shellesc package).
(3) New features
- (a) All rotation commands can now use the rotation-code as an argument;
- for example, the rotation \rr{D} can now be typeset using the
- command \cmd{\rr\{D\}} etc. The new rotation commands are:
- \rr{<rotation-code>}
- \rrh{<rotation-code>}
- \Rubik{<rotation-code>}
- \textRubik{<rotation-code>}
- The original rotation command formats (e.g.,\rrD) are still supported
- for backwards compatibility.
-
- (b) \ShowCube and \ShowCubeF are new commands for displaying
- a cube inside a minipage.
+ rubikcube:
+ --- Improved documentation.
+ --- Additional notation for middle slice rotations (`m' notation).
+ --- Additional notation for whole cube rotations (`c' notation).
+ --- Added Randelshofer notation (the `CMST' rotations).
+ --- Two new \Draw.. commands which replace earlier (now deprecated
+ but still supported) versions.
+ --- Six new commands for showing and annotating rotation sequences.
+ --- A new command for setting up a `solved' colour configuration.
+ --- A new command for setting up a `starter cube' for which the whole
+ cube is allocated the default grey colour.
- (c) \RubikCubeGrey is a new command for setting up a `starter cube'
- for which the only allocated colours are those for the centre cubies
- The colour configuration matches that of the \RubikCubeSolved command.
+ rubikrotation:
+ --- better syntax checking
+ --- 4 new macros SequenceInfo, SequenceName, SequenceShort, SequenceLong
+
+ rubikpatterns:
+ --- a new package (a small database of patterns and sequences)
--------------------------------------------------------------------------
RWD Nickalls email: dick@nickalls.org
A Syropoulos email: asyropoulos@yahoo.com
--------------------------------------------------------------------------
-Copyright 2014 RWD Nickalls & A Syropoulos
+Copyright 2017 RWD Nickalls & A Syropoulos
Licence
@@ -68,6 +71,7 @@ The latest version of this license is in
and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.
--------------------------------------------------------------------------
+
The RUBIK bundle consists of the following files
package files:
@@ -77,22 +81,30 @@ package files:
- rubikrotation.ins,
- rubikrotation.dtx,
- rubikrotation.sty,
- - rubikrotation.pl (Perl script)
+ - rubikrotation.pl (Perl script)
+ - rubikpatterns.ins
+ - rubikpatterns.dtx
+ - rubikpatterns.sty
documentation and README:
- rubikcube.pdf
- rubikrotation.pdf,
- - rubikrotationPL.pdf, Prel program documentation
+ - rubikrotationPL.pdf (Perl script documentation)
- rubikrotationPL.tex
- - rubikrotation.1, MAN file for perl script
+ - rubikrotation.1 (MAN file for Perl script)
+ - rubikpatterns.pdf
+ - rubikpatternsLIST.pdf
+ - rubikpatternsLIST.tex
- README.txt (this file)
image files:
- pdf -files for the rubikcube documentation (6 pictures)
- pdf -files for the rubikrotation documentation (4 pictures)
+ - pdf -files for the rubikrotation documentation (1 picture)
examples:
- - example-rot.pdf,
- - example-rot.tex
-bash and bat files (for running rotation examples)
+ - rubikexamples.pdf,
+ - rubikexamples.tex
+bash and bat files (for running rubikexamples.tex and rubikpatternsLIST.tex)
--------------------------------------------------------------------------
-If you have any ideas, questions, suggestions or bugs to report, please
+
+If you have any ideas, suggestions, questions, or bugs to report, please
feel free to contact us.
--------------------------------------------------------------------------
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figB.pdf b/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figB.pdf
deleted file mode 100644
index 5bdd92967c5..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figB.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figF.pdf b/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figF.pdf
deleted file mode 100644
index cc59d3f62b0..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figF.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figD.pdf b/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figD.pdf
deleted file mode 100644
index a5df718d3bc..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figD.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/examples.pdf b/Master/texmf-dist/doc/latex/rubik/examples.pdf
deleted file mode 100644
index 7aae8f46b65..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/examples.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/examples.sh b/Master/texmf-dist/doc/latex/rubik/examples.sh
deleted file mode 100644
index a891b830979..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/examples.sh
+++ /dev/null
@@ -1,5 +0,0 @@
- latex --shell-escape examples.tex
-# latex --shell-escape examples.tex
-
-##echo "...checking error file"
-##grep ERROR ./rubikstateERRORS.dat
diff --git a/Master/texmf-dist/doc/latex/rubik/examples.tex b/Master/texmf-dist/doc/latex/rubik/examples.tex
deleted file mode 100644
index 9f5a1512175..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/examples.tex
+++ /dev/null
@@ -1,467 +0,0 @@
-%%
-%% examples.tex
-%% examples using the rubikrotation package v3.0
-%% Requires rubik packages (v3.0) and also the tikz package
-%% Part of the Rubik bundle (www.ctan.org/pkg/rubik)
-%% RWD Nickalls & A Syropoulos
-%% September 25, 2015
-%%--------NOTE-------------------------------------------
-%% USAGE: (pdf)latex --shell-escape example-rot1.tex
-%% run three times to get all labels and fig nos correct
-%%-------------------------------------------------------
-\documentclass[a4paper]{article}
-\usepackage{tikz} %% load tikz BEFORE rubikcube
-\usepackage{rubikcube,rubikrotation}
-\usepackage{url}
-%-------------
-\pagestyle{myheadings}
-\markright{\textsc{rubikrotation} package v3.0 (Sept 2015) \hspace{0.5cm}\texttt{www.ctan.org/pkg/rubik} \hspace{0.5cm}examples.tex}
-%-----------
-%% some well known sequences (see the web page of Reid)
-\newcommand{\sixTs}{*sixTs,F2,R2,U2,Fp,B,D2,L2,F,B}
-\newcommand{\CubeInCube}{*CubeInCube,F,L,F,Up,R,U,F2,L2,Up,Lp,B,Dp,Bp,L2,U}
-\newcommand{\sixspot}{[sixspot],U,Dp,R,Lp,F,Bp,U,Dp}
-\newcommand{\superflip}{U,R2,Fp,R,Dp,L,Bp,R,Up,R,Up,D,%
-Fp,U,Fp,Up,Dp,B,Lp,Fp,Bp,Dp,Lp}
-%--------------------
-%% brace and bracket
-\newcommand{\Rubikbracket}[1]{$\left(\mbox{#1}\right)$}
-\newcommand{\Rubikbrace}[1]{$\left\{\mbox{#1}\right\}$}
-%---------------
-%% increase text space to make room
-\addtolength{\oddsidemargin}{-1.5cm}
-\addtolength{\textwidth}{3cm}
-\addtolength{\textheight}{1cm}
-%%==================
-
-\begin{document}
-
-\begin{center}
-\Huge{Rubikrotation examples}\,\footnote{These examples are part of the
-\textsc{rubikrotation} package, and assume some familiarity with the Rubik bundle
-documentation \texttt{rubikcube.pdf} and \texttt{rubikrotation.pdf}.}
-\end{center}
-
-\bigskip
-
-\textsc{note}: Since the \verb!\RubikRotation! command calls the perl script
-\texttt{rubikrotation.pl} this \texttt{.tex}~file needs to be run using
-the \verb!--shell-escape! command-line switch, as follows:
-\begin{quote}
-\begin{verbatim}
-latex --shell-escape example-tex
-\end{verbatim}
-\end{quote}
-If you forget to use the command-line switch, the file will run OK, but the cubes
-will remain in the initial `solved' configuration. The \texttt{tikz} package must be
-loaded before the two \texttt{rubik..} packages.
-
-%%------------------
-\section*{Example~1}
-
-In Figure~\ref{fig:cubeincube} we show the so-called ``sixspot'' configuration,
- generated from a solved cube using the rotation sequence
-\rr{U}, \rr{Dp}, \rr{R}, \rr{Lp}, \rr{F}, \rr{Bp}, \rr{U}, \rr{Dp}\
-(see the website of Reid at \url{www.cflmath.edu/~reid/Rubik/patterns.html}).
-%%--------FIGURE 1 -----------
-\begin{figure}[hbt]
-\centering
-\RubikCubeSolved
-\RubikRotation{\sixspot}
-\ShowCube{7cm}{0.7}{\DrawRubikCubeFlat}
-\caption{\label{fig:cubeincube}The so-called `sixspot' configuration (Reid).}
-\end{figure}
-%----------------
-
-{\noindent}Creating a macro to hold a rotation sequence greatly facilitates their
-use, as follows:
-\begin{quote}
-\begin{verbatim}
-\newcommand{\sixspot}{[sixspot],U,Dp,R,Lp,F,Bp,U,Dp}
-\end{verbatim}
-\end{quote}
-We can now process this sequence using its macro name as an argument for the
-\verb!\RubikRotation! command. The code used for the above Figure uses the
-\verb!\ShowCube{}{}{}! command for which \verb!#1! is the minipage width, \verb!#2!
-is the tikzpicture scale factor (0--1), and \verb!#3! is a Rubik \verb!\Draw..! command
-(see \textsc{rubikrotation} documentation for details).
-\begin{quote}
-\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation}
-\thispagestyle{empty} %% disables pagenumbers
-...
-\begin{figure}[hbt]
- \centering
- \RubikCubeSolved
- \RubikRotation{\sixspot}
- \ShowCube{7cm}{0.7}{\DrawRubikCubeFlat}
- \caption{...}
-\end{figure}
-\end{verbatim}
-\end{quote}
-Note that running the `sixspot' sequence 3 times returns the cube to its original `solved'
-state (it is a so-called `order~3' sequence). The~command for processing it three times
-is \verb!\RubikRotation[3]{\sixspot}!.
-
-
-\pagebreak
-%%-------------------------
-\section*{Example~2}
-
- In this example we demonstrate the use of the \verb!\ShowRubikErrors! command, which
- places a copy of the Perl output file \verb!rubikstateERRORS.dat! underneath the graphic
- so you can see a list of all the errors, if any (in this example we have introduced a few
- errors---wrong minipage width, typos and some animals---into the rotation sequence).
- It is important to note that the \verb!\ShowRubikErrors! command must be
- placed \textit{after} the TikZ picture environment (i.e.,~in this case after
-the \verb!\ShowCube! command). Note that full details of all
- errors are also included in the .log file.
-
-%%--------FIGURE 2 -----------
-
-\RubikCubeSolved
-\RubikRotation{[sixspot],U,Dp,R,Lp,F,Bp,U,Dpppp,cat,dog}
-
-\begin{figure}[hbt]
- \centering
- \ShowCubeF{4.5cm}{0.7}{\DrawRubikCubeFlat}
- \ShowRubikErrors
-\parbox{0.7\textwidth}{%
-\caption{\label{fig:cubeincubeE}The same `sixspot' sequence of rotations as shown in
-Example~1, but now with some errors (wrong minipage-width, typos \& animals\,!) in the
-rotation sequence (it should be just \texttt{U,Dp,R,Lp,F,Bp,U,Dp}).}
-}
-\end{figure}
-{\noindent}In this example we have used the F version of the \verb!\ShowCube!
-command (\verb!\ShowCubeF!) which places an fbox around the image so you can see the
-extent of any white space etc. This reveals that the set minipage-width (4.5cm) in the
-\verb!\ShowCubeF! command---see code below---is too narrow: it should be 7cm ($10 \times 0.7$)
-to just include the whole image. Once fixed, we can remove the F from the \verb!\ShowCubeF! command.
-Note also that only `\verb!\Draw...!' commands really need to be inside the TikZ picture environment
-(i.e.,~inside the \verb!\ShowCube! command). The above figure was generated by the following code.
-%-----------------
-\begin{quote}
-\begin{verbatim}
-\RubikCubeSolved
-\RubikRotation{[sixspot],U,Dp,R,Lp,F,Bp,U,Dpppp,cat,dog}
-\begin{figure}[hbt]
- \centering
- \ShowCubeF{4.5cm}{0.7}{\DrawRubikCubeFlat}
- \ShowRubikErrors
-\caption{....}
-\end{figure}
-\end{verbatim}
-\end{quote}
-Even if the \verb!\ShowRubikErrors! command is not used, it is always a good idea to check the
-file \verb!rubikstateERRORS.dat! after a \LaTeX\ run, since this file will reveal any errors.
-
-
-
-\pagebreak
-%-------------------------------
-\section*{Example~3}
-
-In this example we use the \verb!\RubikRotation! command to scramble a `solved' Rubik
-cube via a sequence of 120 random rotations, using the following command (the details
-of the process can be seen in the \texttt{.log} file):
-\begin{quote}
-\begin{verbatim}
-\RubikRotation{random,120}
-\end{verbatim}
-\end{quote}
-In this example, we also save the final configuration (state) to a file
-(\texttt{exampfig4.tex}) using the command
-\verb!\SaveRubikState{exampfig4.tex}!
-so we can display the cube in the same state later (see Example~4) but
-in a different format.
-Note that since we are using a random sequence, it follows that each
-time this file is run not only will a visually different cube be generated,
-but the same state will be shown in both Figures~\ref{fig:randomone} and \ref{fig:randomtwo}.
-%%--------FIGURE 3 -----------
-\begin{figure}[hbt]
- \centering
- \RubikCubeSolved
- \RubikRotation{random,120}
- \SaveRubikState{exampfig4.tex}
- \ShowCube{8.4cm}{0.7}{\DrawRubikFlat}
-\parbox{0.7\textwidth}{%
-\caption{\label{fig:randomone}This shows a cube generated by 120 random rotations}}
-\end{figure}
-%----------------
-\begin{quote}
-\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation}
-...
-\begin{figure}[hbt]
- \centering
- \RubikCubeSolved
- \RubikRotation{random,120}
- \SaveRubikState{exampfig4.tex}
- \ShowCube{8.4cm}{0.7}{\DrawRubikFlat}
-\caption{....}
-\end{figure}
-\end{verbatim}
-\end{quote}
-
-Q: How do we determine the minipage-width (8.4cm) in the \verb!\ShowCube! command?
-
-A: The object is 12 cubie squares wide (1\,cm each). Since the specified TikZ scale factor is~$0.7$
-here, then the true width of the image is $12 \times 0.7 = 8.4$\,cm. If you change the scale then
-the size of the image will change, and a new width will be required to just fit the image.
-
-Note that in this particular case (only a single image in the `figure' environment), since
-the \verb!\ShowCube! command places the image centrally inside the minipage, the image will
-in fact be centrally placed in the \verb!\textwidth! provided the image is \textit{smaller}
-than the fbox---i.e.,~if we used instead a minipage-width of, say, 12\,cm the image would still
- appear centered in the \verb!\textwidth! in this case.
-However, when there are several images in the `figure', then the spacing may appear strange
-unless each image closely fits its own minipage-width etc.
-It is often useful, therefore, to check the size of the fbox (using the \verb!\ShowCubeF! command).
-
-
-
-\pagebreak
-
-%----------------------
-\section*{Example~4}
-
-In this example we display a cube having the same state as that shown in
-Figure~\ref{fig:randomone}. The configuration state was saved from
-Figure~\ref{fig:randomone} using the command
-\verb!\SaveRubikState{exampfig4.tex}!, and then input here
-using \verb!\input{exampfig4.tex}!. These commands therefore allow the
-state of a previous cube to be saved to a file, and then displayed again
-later in a different format.
-%%-----------FIGURE 4 -----------
-\begin{figure}[hbt]
- \centering
- \input{exampfig4.tex}
- \ShowCube{4cm}{0.8}{\DrawRubikCubeLD}
-\parbox{0.7\textwidth}{%
-\caption{\label{fig:randomtwo}This shows a Rubik cube in exactly the same
-state as the one shown in Figure~\ref{fig:randomone}} }
-\end{figure}
-%%---------------------------------
-\begin{quote}
-\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation}
-...
-\begin{figure}[hbt]
- \centering
- \input{exampfig4.tex}
- \Showcube{4cm}{0.8}{\DrawRubikCubeLD}
-\caption{....}
-\end{figure}
-\end{verbatim}
-\end{quote}
-
-
-\pagebreak
-%----------------------
-\section*{Example~5}
-
-Here we show a convenient way of displaying a series of small cubes showing
-a sequence of rotations (\rr{U}, \rr{R}, \rr{F}).
-
-\begin{figure}[hbt]
-\centering
-\RubikCubeSolved
-\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\Rubik{U}
-\RubikRotation{U}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\Rubik{R}
-\RubikRotation{R}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\Rubik{F}
-\RubikRotation{F}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\caption{The rotations \rr{U}, \rr{R}, \rr{F}\ on a solved cube.}
-\end{figure}
-The code for the above sequence is as follows:
-\begin{quote}
-\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation}
-...
-\begin{figure}[hbt]
- \centering
- \RubikCubeSolved
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \Rubik{U}
- \RubikRotation{U}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \Rubik{R}
- \RubikRotation{R}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \Rubik{F}
- \RubikRotation{F}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\caption{The rotations \rr{U}, \rr{R}, \rr{F}\ on a solved cube.}
-\end{figure}
-\end{verbatim}
-\end{quote}
-
-
-\pagebreak
-%----------------------
-\section*{Example~6}
-
-In this example we highlight the fact that commands used inside a TikZ picture
-environment remain local to that environment. Note that this applies with other
-environments too; for example, with both the \verb!\minipage! the \verb!\figure! environments.
-Consequently, it is generally best when drawing a sequence of cubes to reserve the TikZ
-picture environment (i.e.,~the \verb!\ShowCube! command) only for Rubik \verb!\Draw..!
-commands and TikZ commands.
-
-In this example the first cube uses the \verb!\RubikCubeSolved! \textit{inside} the TikZ environment.
-However, if we then perform the rotation \textRubik{R}\ the command \verb!RubikRotation{R}!
-results in something quite unexpected (and obviously not correct). This is because
- the effect of the \verb!\RubikCubeSolved! command is not visible outside its TikZ environment,
-and hence the \verb!RubikRotation{R}! command has to operate on the current globally available
-colour state information; i.e.,~that following the action of the
-\textbackslash\texttt{RubikRotation\{[sixspot],....\}} command in the earlier Example~2
-(shown in Figure~2) which was executed \textit{before, and outside} the \texttt{figure} environment
- in that example, and hence the strange form of the second cube below.
-
-
-\medskip
-
-\begin{minipage}{0.4\textwidth}
-\ShowCube{2cm}{0.5}{%
- \RubikCubeSolved
- \DrawRubikCubeRU
- }
- \hspace{4mm}\Rubik{R}\hspace{5mm}%
- \RubikRotation{R}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\end{minipage}
-%---------------
-\hspace{1cm}
-\begin{minipage}{0.5\textwidth}
-\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation}
-...
-\begin{minipage}{0.4\textwidth}
- \ShowCube{2cm}{0.5}{%
- \RubikCubeSolved
- \DrawRubikCubeRU
- }
- \hspace{4mm}\Rubik{R}\hspace{5mm}%
- \RubikRotation{R}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\end{minipage}
-\end{verbatim}
-\end{minipage}
-
-\bigskip
-
-If we now bring the \verb!\RubikCubeSolved! command out and place it before
-the \verb!\ShowCube! command then its `state' information becomes globally
-accessable, and can therefore be acted upon (\&~updated) by the \verb!\RubikRotation{R}!
-command, and hence is rendered (correctly for us) by the next \verb!\DrawRubikCubeRU! command.
-
-\bigskip
-
-
-\begin{minipage}{0.4\textwidth}
- \RubikCubeSolved
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \hspace{4mm}\Rubik{R}\hspace{5mm}%
- \RubikRotation{R}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\end{minipage}
-%---------------
-\hspace{1cm}
-\begin{minipage}{0.5\textwidth}
-\begin{verbatim}
-\begin{minipage}{0.4\textwidth}
- \RubikCubeSolved
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \hspace{4mm}\Rubik{R}\hspace{5mm}%
- \RubikRotation{R}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\end{minipage}
-\end{verbatim}
-\end{minipage}
-
-
-
-
-\pagebreak
-%----------------------
-\section*{Example~7}
-
-\subsection*{The `superflip' configuration}
-
-Once you have mastered Rubik's cube, then an interesting exercise is to generate
-the so-called `superflip' configuration, in which all the corners are correctly
-solved, while all the edges are flipped.
-
-For the impatient, the superflip sequence of 24 quarter-turn rotations (listed on
-Randelshofer's website (\url{www.randelshofer.ch/rubik/patterns/U080.01.html}) is as follows.
-This converts the solved cube on the left into the configuration shown on the right.
-
-\bigskip
-
-\begin{center}
-\Rubik{U}\Rubik{R}\Rubik{R}\Rubik{Fp}\Rubik{R}\Rubik{Dp}\Rubik{L}\Rubik{Bp}\Rubik{R}%
-\Rubik{Up}\Rubik{R}\Rubik{Up}\Rubik{D}\Rubik{Fp}\Rubik{U}\Rubik{Fp}\Rubik{Up}\Rubik{Dp}%
-\Rubik{B}\Rubik{Lp}\Rubik{Fp}\Rubik{Bp}\Rubik{Dp}\Rubik{Lp}
-\end{center}
-
-\medskip
-
-{\noindent}Surprisingly, this sequence is actually equivalent to
-\Rubikbrace{\Rubikbracket{\Rubik{M}\Rubik{Up}}4, \Rubik{yp}, \Rubik{x}}3
-
-%--------draw the images-------------
-\begin{figure}[hbt]
- \centering
- \RubikCubeSolved%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \hspace{5mm}$\Longrightarrow$\hspace{5mm}%
- \RubikRotation{\superflip}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \hspace{1cm}%
- \ShowCube{5cm}{0.5}{\DrawRubikCubeFlat}
-\caption{Two representations of the superflip configuration.}
-\end{figure}
-%----------------------
-
-%\pagebreak
-
-{\noindent}The full code for the figure above is as follows:
-\begin{quote}
-\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation}
-...
-\begin{center}
-\Rubik{U}\Rubik{R}\Rubik{R}\Rubik{Fp}\Rubik{R}\Rubik{Dp}\Rubik{L}\Rubik{Bp}%
-\Rubik{R}\Rubik{Up}\Rubik{R}\Rubik{Up}\Rubik{D}\Rubik{Fp}\Rubik{U}\Rubik{Fp}%
-\Rubik{Up}\Rubik{Dp}\Rubik{B}\Rubik{Lp}\Rubik{Fp}\Rubik{Bp}\Rubik{Dp}\Rubik{Lp}
-\end{center}
-
-\medskip
-
-%% brace and bracket macros
-\newcommand{\Rubikbracket}[1]{$\left(\mbox{#1}\right)$}
-\newcommand{\Rubikbrace}[1]{$\left\{\mbox{#1}\right\}$}
-
-{\noindent}Surprisingly, this sequence is actually equivalent to
-\Rubikbrace{\Rubikbracket{\Rubik{M}\Rubik{Up}}4, \Rubik{yp}, \Rubik{x}}3
-
-\newcommand{\superflip}{U,R2,Fp,R,Dp,L,Bp,R,Up,R,Up,D,%
-Fp,U,Fp,Up,Dp,B,Lp,Fp,Bp,Dp,Lp}
-
-\begin{figure}[hbt]
- \centering
- \RubikCubeSolved%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \hspace{5mm}$\Longrightarrow$\hspace{5mm}%
- \RubikRotation{\superflip}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \hspace{1cm}%
- \ShowCube{5cm}{0.5}{\DrawRubikCubeFlat}
-\caption{...}
-\end{figure}
-\end{verbatim}
-\end{quote}
-\begin{center}
------- END ------
-\end{center}
-
-\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figA.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figA.pdf
index 63be7621483..63be7621483 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figA.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figA.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubik-doc-figB.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figB.pdf
new file mode 100644
index 00000000000..bb584fe413b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figB.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figC.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figC.pdf
index 53dc10e8395..53dc10e8395 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figC.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figC.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figD.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf
index 26fb68fe62c..26fb68fe62c 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figD.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figE.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figE.pdf
index 5d013ff25a6..5d013ff25a6 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubik-doc-figE.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figE.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubik-doc-figF.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figF.pdf
new file mode 100644
index 00000000000..497cf9722d6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figF.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf b/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf
index 62d8671ee15..769582bad7a 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex b/Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex
new file mode 100644
index 00000000000..d21fedf22c5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex
@@ -0,0 +1,7 @@
+%% filename: rubikexampfig4.tex%
+\RubikFaceUp{G}{B}{R}{W}{O}{Y}{Y}{O}{R}%
+\RubikFaceDown{O}{B}{Y}{R}{R}{R}{W}{O}{W}%
+\RubikFaceLeft{Y}{G}{R}{B}{B}{O}{O}{Y}{B}%
+\RubikFaceRight{W}{G}{Y}{W}{G}{G}{O}{W}{R}%
+\RubikFaceFront{G}{G}{B}{Y}{Y}{B}{W}{R}{B}%
+\RubikFaceBack{B}{O}{O}{R}{W}{Y}{G}{W}{G}%
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf b/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf
new file mode 100644
index 00000000000..34e91dc761f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh b/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh
new file mode 100644
index 00000000000..52b86832b02
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh
@@ -0,0 +1,9 @@
+
+## rubikexamples.sh
+## run twice to get hyperref links correct
+
+ pdflatex --shell-escape rubikexamples.tex
+ pdflatex --shell-escape rubikexamples.tex
+
+## echo "...checking error file"
+## grep ERROR ./rubikstateERRORS.dat
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex b/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex
new file mode 100644
index 00000000000..053efe2e17e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex
@@ -0,0 +1,1313 @@
+%%
+%% rubikexamples.tex
+%% March 03, 2017
+%% Requires rubik bundle v4.0 and also the tikz package
+%% Part of the Rubik bundle (www.ctan.org/pkg/rubik)
+%% authors: RWD Nickalls & A Syropoulos
+%%--------NOTE-------------------------------------------
+%% USAGE: (pdf)latex --shell-escape rubikexamples.tex
+%% run three times to get all labels and fig nos correct
+%%-------------------------------------------------------
+\documentclass[a4paper]{article}
+%------rubik----------
+\usepackage{tikz} %% load tikz BEFORE rubikcube
+\usepackage{rubikcube}
+\usepackage{rubikrotation}
+\usepackage{rubikpatterns}
+%------LUA-----------
+% LuaTeX is a Unicode engine (as is XeTeX)
+\usepackage{ifluatex}
+\ifluatex
+ \usepackage{fontspec}
+\fi
+%--------------------
+\usepackage{url}
+\usepackage{ifpdf}
+\usepackage{lmodern}
+%---------------------
+\ifpdf
+ \usepackage[verbose]{microtype}
+ \usepackage{cmap}
+ \usepackage[pdfencoding=auto]{hyperref}
+
+ \hypersetup{%
+ pdftitle={rubikexamples.pdf},
+ pdfsubject={Rubik cube, Rubik bundle},
+ pdfkeywords={Rubik cube LaTeX}
+ }
+\fi
+%%-------------------
+
+
+%-------------
+\pagestyle{myheadings}
+\markright{\texttt{rubikexamples.pdf} \ \
+(Rubik bundle v4.0, March 03, 2017) \hspace{0.5cm}\texttt{www.ctan.org/pkg/rubik}}
+%-----------
+%% brace and bracket
+\newcommand{\Rubikbracket}[1]{$\left(\mbox{#1}\right)$}
+\newcommand{\Rubikbrace}[1]{$\left\{\mbox{#1}\right\}$}
+\newcommand{\cubenumber}[1]{\strut\raisebox{1cm}{#1}}
+\newcommand{\leftface}{\textsc{left}\ face}
+\newcommand{\rightface}{\textsc{right}\ face}
+\newcommand{\upface}{\textsc{up}\ face}
+\newcommand{\downface}{\textsc{down}\ face}
+\newcommand{\frontface}{\textsc{front}\ face}
+\newcommand{\backface}{\textsc{back}\ face}
+%---------------------------------
+%% increase text height and width
+\addtolength{\oddsidemargin}{-1.5cm}
+\addtolength{\textwidth}{3cm}
+\addtolength{\textheight}{1cm}
+%----------------------
+\begin{document}
+
+\ifpdf\pdfbookmark[1]{Title}{Title}\fi
+\title{Rubik examples\\
+\smallskip\normalsize\texttt{www.ctan.org/tex-archives/macros/latex/contrib/rubik/rubikexamples.pdf}
+\,\footnote{This file is part of the Rubik bundle. To generate this file,
+use the following command: \newline \texttt{\$ pdflatex --shell-escape rubikexamples.tex}}}
+\author{RWD Nickalls\,\footnote{email: \textsf{dick@nickalls.org}}%
+ \ \ \& A Syropoulos\,\footnote{email: \textsf{asyropoulos@yahoo.com}}}
+\date{03 March 2017 (v4.0)}
+\maketitle
+
+
+%%------------------
+\section{Preliminaries}
+
+
+These examples were generated using the \TeX\
+Rubik bundle\,\footnote{\url{http://www.ctan.org/pkg/rubik}} v4.0. They assume some
+familiarity with the three complementary packages \textsc{rubikcube},
+\textsc{rubikrotation} and \textsc{rubikpatterns}. For~documentation see the files:
+
+\begin{quote}
+\begin{verbatim}
+rubikcube.pdf
+rubikrotation.pdf
+rubikpatterns.pdf
+rubikpatternsLIST.pdf
+\end{verbatim}
+\end{quote}
+
+
+This file requires the following packages: \texttt{tikz, rubikcube, rubikrotation,
+rubikpatterns}; note that the \texttt{tikz} package must be loaded \textit{before}
+the \texttt{rubikcube} package.
+
+This file needs to be run using the \verb!--shell-escape! command-line option;
+for example:
+\begin{quote}
+\begin{verbatim}
+pdflatex --shell-escape rubikexample.tex
+\end{verbatim}
+\end{quote}
+This is because nearly all the examples make use of the \verb!\RubikRotation!
+command, which calls the Perl script \texttt{rubikrotation.pl}.
+If you do forget to use the command-line switch, the file will still run, but
+all the cubes will remain in the initial unprocessed configuration.
+
+
+\subsection{Environments}
+
+When using the Rubik bundle one sometimes needs to be mindful of the various
+\LaTeX\ environments in which Rubik commands are placed (e.g.,~the figure,
+minipage and TikZ picture environments), since these environments restrict
+the actions of commands they contain to the particular environment.
+The \verb!\ShowCube! command is also relevant here, since it is a
+minipage-wrapper for the TikZ picture environment. Only Rubik \verb!\Draw..!
+commands actually need to be inside a TikZ picture environment.
+
+This issue arises because the Rubik bundle allows you to create figures
+showing different stages during a sequence of rotations. Consequently
+the effects of commands executed inside an environment (especially
+commands which determine the colour-state or rotations), may not be
+apparent to subsequent commands outside that particular environment.
+See Example~3 for an illustration of how to handle environments.
+
+\pagebreak
+
+%%------------------
+\section{Examples}
+
+\subsection{Sixspot}
+\typeout{---Example (sixspot)}
+
+In Figure~\ref{fig:cubeincube} we show the so-called ``sixspot'' configuration,
+ generated from a solved cube using the rotation sequence
+\rr{U}, \rr{Dp}, \rr{R}, \rr{Lp}, \rr{F}, \rr{Bp}, \rr{U}, \rr{Dp}.
+
+%%--------FIGURE 1 -----------
+\begin{figure}[hbt]
+\centering
+\RubikCubeSolved
+\RubikRotation{\sixspot}
+\ShowCube{7cm}{0.7}{\DrawRubikCubeSF}
+\caption{\label{fig:cubeincube}The `sixspot' configuration.}
+\end{figure}
+%----------------
+
+{\noindent}Creating a macro to hold a rotation sequence greatly facilitates
+their use, as follows:
+\begin{quote}
+\begin{verbatim}
+\newcommand{\sixspot}{[sixspot],U,Dp,R,Lp,F,Bp,U,Dp}
+\end{verbatim}
+\end{quote}
+We can now process this sequence using its macro name as an argument for the
+\verb!\RubikRotation! command. The code used for the above Figure uses the
+\verb!\ShowCube{}{}{}! command for which \verb!#1! is the minipage width, \verb!#2!
+is the tikzpicture scale factor (0--1), and \verb!#3! can include \textsc{rubikcube}
+package \verb!\Draw..! commands, and any commands which are valid for use in a
+TikZ \texttt{tikzpicture} environment. The code for the above figure is as follows:
+\begin{quote}
+\begin{verbatim}
+\begin{figure}[hbt]
+ \centering
+ \RubikCubeSolved
+ \RubikRotation{\sixspot}
+ \ShowCube{7cm}{0.7}{\DrawRubikCubeSF}
+\caption{...}
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+Note that the sixspot sequence is a so-called `order~3' sequence, which means that
+running the `sixspot' sequence 3 times returns the cube to its original `solved'
+state. The~command for processing it three times is \verb!\RubikRotation[3]{\sixspot}!.
+
+Note that the semi-flat form of the cube here is generated by the
+ \verb!\DrawRubikCubeSF! command, where the terminal SF denotes the Semi-Flat form.
+
+
+
+\subsubsection{Log-file extract}
+
+Users may find it instructive to inspect the the log-file and follow the dynamic
+interaction between \LaTeX\ and the Perl script.
+This is easy to follow, since output by \texttt{rubikrotation.sty} is prefixed
+by 3 dashes (\verb!---!), while output by the Perl script is prefixed by
+3 dots (\verb!...!). Search for the keyword `Example', as this is written to
+the log-file at the start of each example.
+
+The following is the log-file extract associated with Example~1 (from the
+author's Debian Linux platform).
+
+\begin{quote}
+\begin{verbatim}
+---Example (sixspot)
+LaTeX Font Info: Try loading font information for T1+cmss on input line 134.
+
+(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1cmss.fd
+File: t1cmss.fd 2014/09/29 v2.5h Standard LaTeX font definitions
+)
+---TeX process (rubikrotation.sty)-------
+---NEW rotation command------------------
+---command = RubikRotation[1]{[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*, 8f*)>}
+---writing current Rubik state to file rubikstate.dat
+\openout7 = `rubikstate.dat'.
+
+\ourRRcounter=\count121
+---CALLing Perl script (rubikrotation.pl)
+runsystem(perl rubikrotation.pl -i rubikstate.dat -o rubikstateNEW.dat)...execu
+ted.
+
+---inputting NEW datafile (data written by Perl script)
+(./rubikstateNEW.dat
+
+...PERL process..................................
+...script = rubikrotation.pl v4.0 (03 March 2017)
+...reading the current rubik state (from File: rubikstate.dat)
+...up,W,W,W,W,W,W,W,W,W
+...down,Y,Y,Y,Y,Y,Y,Y,Y,Y
+...left,B,B,B,B,B,B,B,B,B
+...right,G,G,G,G,G,G,G,G,G
+...front,O,O,O,O,O,O,O,O,O
+...back,R,R,R,R,R,R,R,R,R
+...
+...command=checkstate
+...checking state of cube
+...cubiesum = 54 (Red=9, Or=9, Ye=9, Gr=9, Bl=9, Wh=9, X=0)
+...
+...command=rotation,[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*, 8f*)>
+...dataline = rotation,[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*; 8f*)>
+...[SixSpot] is a label OK
+...rotation U, OK
+...rotation Dp, OK
+...rotation R, OK
+...rotation Lp, OK
+...rotation F, OK
+...rotation Bp, OK
+...rotation U, OK
+...rotation Dp, OK
+...writing new Rubik state to file rubikstateNEW.dat
+...SequenceName = SixSpot
+...SequenceInfo = (8q*; 8f*)
+...SequenceShort = [SixSpot],U,Dp,R,Lp,F,Bp,U,Dp
+...SequenceLong = U,Dp,R,Lp,F,Bp,U,Dp
+)
+\end{verbatim}
+\end{quote}
+
+
+
+\pagebreak
+%%-------------------------
+
+\subsection{ShowRubikErrors}
+\typeout{---Example (ShowRubikErrors)}
+
+
+ In this example we demonstrate the use of the \verb!\ShowRubikErrors! command,
+ which places a copy of the Perl output file \verb!rubikstateERRORS.dat!
+ underneath the graphic so you can see a list of all the errors, if any.
+ Note that this example is similar to the previous one except that we have
+ introduced several errors---e.g.,~bad minipage width, typos, as well as
+ some animals---into the rotation sequence).
+ It is important to note that the \verb!\ShowRubikErrors! command must be
+ placed \textit{after} the TikZ picture environment (i.e.,~in this case after
+the \verb!\ShowCube! command), or even at the end of the document.
+Note that full details of all errors are also included in the .log file.
+
+%%--------FIGURE 2 -----------
+
+\RubikCubeSolved
+\RubikRotation{[sixspot],U,Dp,R,Lp,F,Bp,U,Dpppp,cat,dog}
+
+\begin{figure}[hbt]
+ \centering
+ \ShowCubeF{4.5cm}{0.5}{\DrawRubikCubeF}
+ \ShowRubikErrors
+\parbox{0.8\textwidth}{%
+\caption{\label{fig:cubeincubeE}The same `sixspot' sequence of rotations as shown
+in Example~1, but now with some errors (wrong minipage width, typos and some
+animals\,!) in the rotation sequence (it \textit{should} be just
+\texttt{U,Dp,R,Lp,F,Bp,U,Dp}).}}
+\end{figure}
+
+{\noindent}In this example we have used the F version of the \verb!\ShowCube!
+command (\verb!\ShowCubeF!) which places an fbox around the image so you can see the
+extent of any white space etc. This reveals that the set minipage-width ($4.5$cm) in
+the \verb!\ShowCubeF! command---see code below---is too narrow: it should be
+5cm ($10 \times 0.5$) to just include the whole image (i.e.,~$10 \times$ the TikZ
+scale-factor in this case).
+Once fixed, we can remove the F from the \verb!\ShowCubeF! command.
+Note also that only `\verb!\Draw...!' commands really need to be inside the TikZ
+picture environment (i.e.,~inside the \verb!\ShowCube! command). The above figure
+was generated by the following code.
+%-----------------
+\begin{quote}
+\begin{verbatim}
+\RubikCubeSolved
+\RubikRotation{[sixspot],U,Dp,R,Lp,F,Bp,U,Dpppp,cat,dog}
+\begin{figure}[hbt]
+ \centering
+ \ShowCubeF{4.5cm}{0.7}{\DrawRubikCubeF}
+ \ShowRubikErrors
+\caption{....}
+\end{figure}
+\end{verbatim}
+\end{quote}
+Even if the \verb!\ShowRubikErrors! command is not used, it is always a good idea
+to check the file \verb!rubikstateERRORS.dat! after a \LaTeX\ run, since this
+file will also reveal any errors.
+
+Note that the completely flat form of the cube here is generated by the
+ \verb!\DrawRubikCubeF! command, where the terminal F denotes the Flat form.
+
+
+
+\pagebreak
+%----------------------
+
+\subsection{Environments}
+\typeout{---Example (Environments)}
+
+
+In this example we highlight the fact that Rubik commands used inside a \LaTeX\
+environment remain local to that environment, and how this can sometimes be
+problematic. Commands whose reach is meant to be more global need to be
+executed outside such environments, where they can implement global colour
+settings, which will then be accessible to Rubik \verb!\Draw..! commands inside
+subsequent environments.
+
+Since we are drawing images, this is primarily an issue
+with the the \verb!\minipage!, \verb!\figure!, and TikZ picture environments.
+Consequently, it is generally best when drawing a sequence of cubes to reserve
+the TikZ picture environment only for Rubik \verb!\Draw..! commands and TikZ
+commands. Importantly, this also applies to the commonly used \verb!\ShowCube!
+command, since this is a minipage-wrapper for the TikZ picture environment
+(see the \textsc{rubikcube} package documentation).
+
+In this example the first cube (9a) uses a \verb!\RubikCubeSolved! command
+\textit{inside} a \verb!\ShowCube! environment. However, if we now perform the
+rotation \textRubik{R}\ (using the command \verb!\RubikRotation{R}!) this results
+in a quite unexpected effect on cube (9b) (and obviously not correct). This is because
+ the effect of the initial \verb!\RubikCubeSolved! command
+ (setting a new colour-state) is not visible outside its \verb!\ShowCube!
+ environment, and hence the subsequent \verb!\RubikRotation{R}! command is unaware
+ of this recent attempt to update the global colour-state information.
+ It turns out that this was actually last updated following the action of the \textbackslash\texttt{RubikRotation\{[sixspot],....\}} command used in
+Example~2, being the last colour-state command executed \textit{outside} an
+environment (a \texttt{figure} environment in that example). Consequently,
+the strange form of cube (9b) is not what we expected.
+
+
+\medskip
+\noindent%
+\cubenumber{9a}%
+\ShowCube{2cm}{0.5}{%
+ \RubikCubeSolved%
+ \DrawRubikCubeRU}%
+\quad\Rubik{R}%
+\RubikRotation{R}%
+\cubenumber{9b}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+%---------------
+\hspace{5mm}
+\begin{minipage}{0.5\textwidth}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation}
+\newcommand{\cubenumber}[1]{\strut\raisebox{1cm}{#1}}
+...
+\cubenumber{9a}%
+\ShowCube{2cm}{0.5}{%
+ \RubikCubeSolved%
+ \DrawRubikCubeRU%
+ }%
+\quad\Rubik{R}%
+\RubikRotation{R}%
+\cubenumber{9b}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\end{verbatim}
+\end{minipage}
+
+\bigskip
+
+If we now bring the \verb!\RubikCubeSolved! command out and place it before
+the \verb!\ShowCube! command then its `state' information becomes globally
+accessible (i.e.,~colour-state gets updated), and therefore gets used by the
+\verb!\RubikRotation{R}! command, and hence cube (9d) is rendered correctly.
+
+\bigskip
+
+\noindent%
+\RubikCubeSolved%
+\cubenumber{9c}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\quad\Rubik{R}%
+\RubikRotation{R}%
+\cubenumber{9d}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+%---------------
+\hspace{5mm}
+\begin{minipage}{0.5\textwidth}
+\begin{verbatim}
+\RubikCubeSolved%
+\cubenumber{9c}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\quad\Rubik{R}%
+\RubikRotation{R}%
+\cubenumber{9d}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\end{minipage}
+\end{verbatim}
+\end{minipage}
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Coordinates}
+\typeout{---Example (coordinates)}
+
+
+For all cubes the origin of coordinates is defined as the bottom left corner of
+the \frontface. Consequently, it is easy to determine the coordinates of points
+and hence draw lines, circles, and place lettering or other objects using the
+standard TikZ \verb!\draw..! and \verb!\node..! commands. Note that for
+convenience point $P$ is designed to be $(-1,-1)$ on the 2D view.
+(The~following diagram is Fig~1 from the \textsc{rubikcube} package documentation).
+
+
+\begin{figure}[hbt]
+\centering
+\RubikFaceFrontAll{X} % X = default = grey
+\ShowCube{5.6cm}{0.7}{%
+ \DrawFlatFront
+
+\draw[line join=round,line cap=round,ultra thick] (0,0) -- (0,4); % Y
+\draw[line join=round,line cap=round,ultra thick] (0,0) -- (4,0); % X
+
+%draw labels
+\node (Ylabel) at (-0.35, 3.8) {$Y$};
+\node (Xlabel) at ( 3.8, -0.4) {$X$};
+
+
+%%----------draw the Rubik faces--------
+%% outline Front face
+\draw[line join=round,line cap=round,ultra thick]%
+ (0,3) -- (-1,2) -- (-1,-1) -- (2,-1) -- (3,0);
+%%
+%% outline Down face
+\draw[line join=round,line cap=round,ultra thick]%
+ (-1,-1) -- (0, 0);
+%%
+%%
+%% draw labels
+\node (Y0) at (-0.4, 0) [blue]{$0$};
+\node (Y1) at (-0.4, 1) [blue]{$1$};
+\node (Y2) at (-0.4, 2) [blue]{$2$};
+\node (Y3) at (-0.4, 3) [blue]{$3$};
+%%
+\node (X0) at (0, -0.5) [blue]{$0$};
+\node (X1) at (1, -0.5) [blue]{$1$};
+\node (X2) at (2, -0.5) [blue]{$2$};
+\node (X3) at (3, -0.5) [blue]{$3$};
+%%
+\node (P) at (-2.4, -1) [blue]{$P\,(-1,-1)$};
+}
+\end{figure}
+
+
+
+{\noindent}The code for the figure is given below.
+
+We draw everything in the \verb!\ShowCube! environment; the \frontface\
+in grey (colour code = \texttt{X}) using the Rubik command
+\verb!\DrawFlatFront{X}!, and then draw all the lines and text using standard
+TikZ commands. The correct minipage-width argument (5.6cm) for the
+\verb!\ShowCube! command is determined by trial-and-error, using the `fbox'
+form of the command (\verb!\ShowCubeF!), and then the `F' is removed
+($\rightarrow$ \verb!\ShowCube!). In order to avoid confusion, all Rubik commands
+start with a capital letter (e.g.,~\verb!\Draw..!), while all TikZ commands
+start with a lower-case letter (e.g.,~\verb!\draw..!).
+
+\begin{quote}
+\begin{verbatim}
+\begin{figure}[hbt]
+\centering
+\RubikFaceFrontAll{X}% X = default non-colour (grey)
+\ShowCube{5.6cm}{0.7}{%
+ \DrawFlatFront
+ \draw[line join=round,line cap=round,ultra thick] (0,0) -- (0,4);% Yaxis
+ \draw[line join=round,line cap=round,ultra thick] (0,0) -- (4,0);% Xaxis
+ \node (Ylabel) at (-0.35, 3.8) {$Y$};
+ \node (Xlabel) at ( 3.8, -0.4) {$X$};
+ %% outline Left and Down faces
+ \draw[line join=round,line cap=round,ultra thick]%
+ (0,3) -- (-1,2) -- (-1,-1) -- (2,-1) -- (3,0);
+ \draw[line join=round,line cap=round,ultra thick]%
+ (-1,-1) -- (0, 0);
+ \node (Y0) at (-0.4, 0) [blue]{$0$};
+ \node (Y1) at (-0.4, 1) [blue]{$1$};
+ \node (Y2) at (-0.4, 2) [blue]{$2$};
+ \node (Y3) at (-0.4, 3) [blue]{$3$};
+ \node (X0) at (0, -0.5) [blue]{$0$};
+ \node (X1) at (1, -0.5) [blue]{$1$};
+ \node (X2) at (2, -0.5) [blue]{$2$};
+ \node (X3) at (3, -0.5) [blue]{$3$};
+ \node (P) at (-2.4, -1) [blue]{$P\,(-1,-1)$};
+ }
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Face notation}
+\typeout{---Example (face notation)}
+
+
+%% = my Fig A (rubikcube.dtx)
+
+The following diagram is Fig~2 from the \textsc{rubikcube} package documentation.
+
+\begin{figure}[htb]
+\centering%
+\RubikFaceUpAll{Y}
+\RubikFaceFrontAll{G}
+\RubikFaceRightAll{O}
+\ShowCubeF{5cm}{0.6}{%
+\DrawRubikCubeRU%
+%%-----------------
+
+%% Right
+\draw[line width=2pt,color=blue,->] (3.5,2) -- (5.3, 2);
+\node (R) at (4.6, 2.5) [blue]{\textbf{\textsf{R}}};
+\node (x) at (5.8, 2) [blue]{\textbf{\textsf{x}}};
+
+%%Left
+\draw[line width=2pt,color=blue] (-0.2,2) -- (-1.5, 2);
+\node (L) at (-1.1, 2.5) [blue]{\textbf{\textsf{L}}};
+
+%%Up
+\draw[line width=2pt,color=blue,->] (2, 3.5) -- (2, 5.5);
+\node (U) at (1.4, 4.7) [blue]{\textbf{\textsf{U}}};
+\node (y) at (2, 6.1) [blue]{\textbf{\textsf{y}}};
+
+%%Down
+\draw[line width=2pt,color=blue] (2, -0.2) -- (2, -1.5);
+\node (D) at (2.6, -1.1) [blue]{\textbf{\textsf{D}}};
+
+
+%%Front
+\draw[line width=2pt,color=blue,->] (1.5, 1.5) -- (0, -1);
+\node (F) at (0.7, -0.7) [blue]{\textbf{\textsf{F}}};
+\node (z) at (-0.3, -1.4) [blue]{\textbf{\textsf{z}}};
+
+%%Back
+\draw[line width=2pt,color=blue] (3.2, 4.2) -- (4, 5.5);
+\node (B) at (4.4, 5) [blue]{\textbf{\textsf{B}}};
+%%
+}
+\end{figure}
+
+{\noindent}The code for the figure is as follows
+(the origin $(0,0)$ is at the bottom left corner of the \frontface).
+
+
+\begin{quote}
+\begin{verbatim}
+\begin{figure}[htb]
+\centering%
+\RubikFaceUpAll{Y}
+\RubikFaceFrontAll{G}
+\RubikFaceRightAll{O}
+\ShowCubeF{5cm}{0.6}{%
+ \DrawRubikCubeRU%
+ %% Right
+ \draw[line width=2pt,color=blue,->] (3.5,2) -- (5.3, 2);
+ \node (R) at (4.6, 2.5) [blue]{\textbf{\textsf{R}}};
+ \node (x) at (5.8, 2) [blue]{\textbf{\textsf{x}}};
+ %%Left
+ \draw[line width=2pt,color=blue] (-0.2,2) -- (-1.5, 2);
+ \node (L) at (-1.1, 2.5) [blue]{\textbf{\textsf{L}}};
+ %%Up
+ \draw[line width=2pt,color=blue,->] (2, 3.5) -- (2, 5.5);
+ \node (U) at (1.4, 4.7) [blue]{\textbf{\textsf{U}}};
+ \node (y) at (2, 6.1) [blue]{\textbf{\textsf{y}}};
+ %%Down
+ \draw[line width=2pt,color=blue] (2, -0.2) -- (2, -1.5);
+ \node (D) at (2.6, -1.1) [blue]{\textbf{\textsf{D}}};
+ %%Front
+ \draw[line width=2pt,color=blue,->] (1.5, 1.5) -- (0, -1);
+ \node (F) at (0.7, -0.7) [blue]{\textbf{\textsf{F}}};
+ \node (z) at (-0.3, -1.4) [blue]{\textbf{\textsf{z}}};
+ %%Back
+ \draw[line width=2pt,color=blue] (3.2, 4.2) -- (4, 5.5);
+ \node (B) at (4.4, 5) [blue]{\textbf{\textsf{B}}};
+ }
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Grey cube}
+\label{sec:greycube}
+\typeout{---Example (grey cube)}
+
+
+When explaining elementary layer~1 moves, it can be useful to use the `grey cube'
+(\verb!\RubikCubeGrey!), as this sets up only the central cubie on each face;
+we have shown the first cube in Semi-Flat (SF) mode simply to show how the grey
+cube is configured (note that an `all-grey' cube is also available:
+\verb!\RubikCubeAllGrey!). Both of these grey cube commands will also accept
+the word `gray' (to be consistent with TikZ).
+
+In this example, we show how to position a single `flipped' white/orange edge
+cubie in the top layer.
+
+
+\begin{figure}[hbt]
+
+\centering%
+\RubikCubeGrey%
+\RubikFaceUp{X}{X}{X}%
+ {X}{W}{O}%
+ {X}{X}{X}%
+
+\RubikFaceRight{X}{W}{X}
+ {X}{G}{X}
+ {X}{X}{X}
+%
+\cubenumber{1}%
+\ShowCube{5cm}{0.5}{\DrawRubikCubeSF}%
+%------------------
+\quad\Rubik{Rp}\RubikRotation{Rp}
+\cubenumber{2}%
+\ShowCube{2cm}{0.5}{\DrawRubikCube}%
+%-----------------------
+\quad\Rubik{Fp}\RubikRotation{Fp}
+\cubenumber{3}%
+\ShowCube{2cm}{0.5}{\DrawRubikCube}%
+%-----------------------
+\end{figure}
+
+
+
+{\noindent}The code for the figure is given below.
+After setting up the first cube, we then just use the \verb!\RubikRotation!
+command to generate the remaining cubes.
+The colours are coded as follows: R~(red), O~(orange), Y~(yellow),
+G~(green), B~(blue), W~(white), and X~(grey).
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation}
+\newcommand{\cubenumber}[1]{\strut\raisebox{1cm}{#1}}
+...
+\begin{figure}[hbt]
+\centering
+% set up the first cube
+\RubikCubeGrey%
+\RubikFaceUp{X}{X}{X}%
+ {X}{W}{O}%
+ {X}{X}{X}%
+
+\RubikFaceRight{X}{W}{X}
+ {X}{G}{X}
+ {X}{X}{X}
+\cubenumber{1}%
+\ShowCube{5cm}{0.5}{\DrawRubikCubeSF}%
+%
+\quad\Rubik{Rp}\RubikRotation{Rp}
+\cubenumber{2}%
+\ShowCube{2cm}{0.5}{\DrawRubikCube}%
+%
+\quad\Rubik{Fp}\RubikRotation{Fp}
+\cubenumber{3}%
+\ShowCube{2cm}{0.5}{\DrawRubikCube}%
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+
+
+
+\pagebreak
+
+%-------------------------------
+\subsection{Scramble a cube}
+\label{sec:scrambleacube}
+\typeout{---Example (scramble a cube)}
+
+
+In this example we use the \verb!\RubikRotation! command to scramble a `solved'
+Rubik cube via a sequence of 120 random rotations, using the following command
+(the details of the process can be seen in the \texttt{.log} file):
+\begin{quote}
+\begin{verbatim}
+\RubikRotation{random,120}
+\end{verbatim}
+\end{quote}
+On this occasion we draw the cube Flat (F) using the command \verb!\DrawRubikCubeF!.
+In this example, we also make use of the \verb!\SaveRubikState{}! command to save
+the final configuration (state) to a file (\texttt{rubikexampfig4.tex}) using
+\verb!\SaveRubikState{rubikexampfig4.tex}!,
+so we can display the same cube configuration later but in a different format
+(we show it again in the following example (Example~\ref{sec:saverubikstate}).
+Note that since we are using a random sequence, it follows that each
+time this file is run not only will a visually different cube be generated,
+but the same state will be shown in both
+here and in Example~\ref{sec:saverubikstate}.
+%%--------FIGURE 3 -----------
+\begin{figure}[hbt]
+ \centering
+ \RubikCubeSolved
+ \RubikRotation{random,120}
+ \SaveRubikState{rubikexampfig4.tex}
+ \ShowCubeF{6cm}{0.5}{\DrawRubikCubeF}
+\parbox{0.7\textwidth}{%
+\caption{\label{fig:randomone}This shows a cube generated by 120 random rotations}}
+\end{figure}
+%----------------
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation}
+...
+\begin{figure}[hbt]
+ \centering
+ \RubikCubeSolved
+ \RubikRotation{random,120}
+ \SaveRubikState{rubikexampfig4.tex}
+ \ShowCubeF{6cm}{0.5}{\DrawRubikCubeF}
+\caption{....}
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+{\noindent}Q: How do we determine the minipage-width ($7.2$cm) in the
+\verb!\ShowCube! command?
+
+\smallskip
+
+{\noindent}A: The object is 12~cubie squares wide. Since the TikZ scale-factor
+argument of the \verb!\ShowCube! command (cms/unit length; default = 1) in this
+case is set to~$0.5$, then the true width of the image will
+be $12 \times 0.5 = 6$\,cm. Note that here we have used the \verb!\ShowCubeF!
+command and so we can see that this is correct. Changing the scale-factor will
+change the image size and hence a new width argument will be required to just fit
+the image.
+
+Note that in this particular case (where there is only a single image in the
+`figure' environment), since the \verb!\ShowCube! command places the image
+(in a TikZ picture environment) centrally inside a minipage, the image will
+in fact be centrally placed in the \verb!\textwidth! provided the image
+is \textit{smaller} than the fbox---i.e.,~if we used instead a minipage-width of,
+say, 12\,cm the image would still appear centred in the \verb!\textwidth! in
+this case. However, when there are several images in the `figure', then the spacing
+may appear strange unless each image closely fits its own minipage-width etc.
+It is often useful, therefore, to check the size of the fbox (using the
+\verb!\ShowCubeF! command) as we have done here.
+
+
+
+\pagebreak
+
+%----------------------
+\subsection{SaveRubikState}
+\label{sec:saverubikstate}
+\typeout{---Example (SaveRubikState)}
+
+In this example we display a cube having the same state as that shown in
+the previous example (Example~\ref{sec:scrambleacube}). The configuration state
+was saved from Figure~\ref{fig:randomone} using the command
+\verb!\SaveRubikState{rubikexampfig4.tex}!, and then input here
+using \verb!\input{rubikexampfig4.tex}!. These commands therefore allow the
+state of a previous cube to be saved to a file, and then displayed again
+later in a different format.
+%%-----------FIGURE 4 -----------
+\begin{figure}[hbt]
+ \centering
+ \input{rubikexampfig4.tex}
+ \ShowCube{4cm}{0.8}{\DrawRubikCubeLD}
+\parbox{0.7\textwidth}{%
+\caption{\label{fig:randomtwo}This shows a Rubik cube in exactly the same
+state as the one shown in Figure~\ref{fig:randomone}} }
+\end{figure}
+%%---------------------------------
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation}
+...
+\begin{figure}[hbt]
+ \centering
+ \input{rubikexampfig4.tex}
+ \Showcube{4cm}{0.8}{\DrawRubikCubeLD}
+\caption{....}
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Series of cubes}
+\typeout{---Example (series of cubes)}
+
+Here we show a convenient way of displaying a series of small cubes showing
+a sequence of rotations (\rr{U}, \rr{R}, \rr{F}).
+
+
+\begin{figure}[hbt]
+\centering
+\RubikCubeSolved
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\quad\Rubik{U}\quad%
+\RubikRotation{U}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\quad\Rubik{R}\quad%
+\RubikRotation{R}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\quad\Rubik{F}\quad%
+\RubikRotation{F}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\caption{The rotations \rr{U}, \rr{R}, \rr{F}\ on a solved cube.}
+\end{figure}
+
+{\noindent}The code for the above sequence is as follows:
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation}
+...
+\begin{figure}[hbt]
+ \centering%
+ \RubikCubeSolved%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \quad\Rubik{U}\quad%
+ \RubikRotation{U}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \quad\Rubik{R}\quad%
+ \RubikRotation{R}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \quad\Rubik{F}\quad%
+ \RubikRotation{F}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\caption{The rotations \rr{U}, \rr{R}, \rr{F}\ on a solved cube.}
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+{\noindent}Note that we are starting with the default white-opposite-yellow (WY)
+solved cube, using the command \verb!\RubikCubeSolved!, which is functionally
+the same as the more explicit \verb!\RubikCubeSolvedWY! (if you forget the
+terminal two letters then at least you will get a `solved' cube).
+A white-opposite-blue (WB) solved cube is available as \verb!\RubikCubeSolvedWB!.
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Rotation sequence}
+\typeout{---Example (rotation sequence)}
+
+We now explore using the named Rubik cube rotation sequences and associated
+patterns available in the \textsc{rubikpatterns} package---a small macro database
+(see the \textsc{rubikpatterns} documentation, and also its companion file \texttt{rubikpatternsLIST.pdf}). Having the sequences available as macros is
+very convenient since (a)~it avoids making errors when typing them out,
+and (b)~allows the easy application of software tools.
+
+ A Rubik pattern is the configuration generated by a sequence of rotations
+ (or `moves') from some initial starting configuration (typically a `solved'
+ configuration). For example, FourSpot is a well known pattern which we can
+ generate from a solved Rubik cube using the macro \verb!\FourSpot!; it is
+ defined as follows:
+\begin{quote}
+\begin{verbatim}
+\newcommand{\FourSpot}{[FourSpot],F2,B2,U,Dp,R2,L2,U,Dp,<(12q*, 8f*)>}
+\newcommand{\fourspot}{\FourSpot}
+\end{verbatim}
+\end{quote}
+ Note that for convenience the macros names in the \textsc{rubikpatterns} package
+ are defined in both upper and lower-case (i.e.,~the macros \verb!\FourSpot!
+ and \verb!\fourspot! are identical). The following figure shows the FourSpot
+ sequence and pattern.
+
+\bigskip
+
+\noindent%
+\RubikCubeSolvedWY
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRD}
+\RubikRotation{\FourSpot}
+\quad\SequenceBraceA{FourSpot}{%
+ \ShowSequence{}{\Rubik}{\SequenceLong}%
+ }
+\quad\ShowCube{2cm}{0.5}{\DrawRubikCubeSF}
+
+\bigskip
+
+{\noindent}The code for the above figure is as follows:
+
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
+...
+\noindent%
+\RubikCubeSolvedWY
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRD}
+\RubikRotation{\FourSpot}
+\quad
+\SequenceBraceA{FourSpot}{%
+ \ShowSequence{}{\Rubik}{\SequenceLong}%
+ }
+\quad
+\ShowCube{2cm}{0.5}{\DrawRubikCubeSF}
+\end{verbatim}
+\end{quote}
+Note that we have spread the code slightly here in order to emphasise that
+the \verb!\ShowSequence! command is being used as an argument for the
+\verb!\SequenceBraceA! command (the `A' in the command \verb!\SequenceBraceA!
+denotes that the annotation is placed Above the sequence.)
+We have used a solved cube with the WY (White opposite Yellow)
+configuration (\verb!\RubikCubeSolvedWY!).
+The first cube is drawn from the RD (Right-Down) viewpoint (\verb!\DrawRubikCubeRD!).
+The second cube is drawn from the SF (Semi-Flat) viewpoint (\verb!\DrawRubikCubeSF!)
+so we can see all the faces.
+
+\pagebreak
+
+%----------------------
+\subsection{SixTs}
+\typeout{---Example (SixTs)}
+
+A more interesting cube pattern is the SixTs configuration (from the
+\textsc{rubikpatterns} package), which we now show in a slightly
+different way (adding an extra face), as follows:
+
+\bigskip
+
+\noindent\hfil%
+\RubikCubeSolvedWB%
+\ShowCube{1.6cm}{0.4}{\DrawRubikCubeRU\DrawFlatDown{0}{-3.3}}%
+\RubikRotation{\sixts}
+\quad\SequenceBraceA{SixTs}{\ShowSequence{,\ }{\texttt}{\SequenceLong}}
+\quad\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\quad\ShowCube{2cm}{0.5}{\DrawFaceFrontSide}%
+\hfil
+
+\bigskip
+
+This time we have started with a solved cube having the WB configuration
+(White opposite Blue), which is generated using the command
+\verb!\RubikCubeSolvedWB!
+(we have added the \downface\ (blue) below to reveal the colour of this
+face---see note below).
+
+The rotation sequence is in `long-format' (expanded into
+separate rotations), comma-separated and space, typewriter font,
+using the command \verb!\ShowSequence{,\ }{\texttt}{\SequenceLong}!.
+
+The final image shows just the \frontface\ together with all the
+side-bars indicating the colours of the adjacent facelets,
+using the \verb!\DrawFaceFrontSide! command. The images are
+separated using \verb!\quad!.
+The code for the above figure is as follows:
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
+...
+\noindent\hfil
+\RubikCubeSolvedWB
+\ShowCube{1.6cm}{0.4}{%
+ \DrawRubikCubeRU%
+ \DrawFlatDown{0}{-3.3}%
+ }
+\RubikRotation{\SixTs}
+\quad\SequenceBraceA{SixTs}{%
+ \ShowSequence{,\ }{\texttt}{\SequenceLong}%
+ }
+\quad\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
+\quad\ShowCube{2cm}{0.5}{\DrawFaceFrontSide}
+\hfil
+\end{verbatim}
+\end{quote}
+
+
+
+\subsubsection*{Notes}
+
+\begin{enumerate}
+
+ \item We have drawn the \downface\ of the first cube using the command
+\verb!\DrawFlatDown{0}{-3.3}! where the two arguments are the $x$ and
+$y$ coordinates of the \textit{bottom left} corner of the \downface\ (blue).
+Note that the grid origin of all cube images coincides with the
+\textit{bottom left} corner of the \frontface\ (green in this case).
+
+\item The first image is really just 4 units wide. This is because the 2D width
+of the \textit{side} face (red) is designed to measure 1~unit wide in the
+oblique view (similarly, the 2D height of the \textit{top} face also measures
+just 1~unit). Consequently, since the TikZ scale factor used is $0.4$, then
+the (minimum) width argument for its \verb!\ShowCube{}{}{}! command is
+$4\times 0.4 = 1.6$cm., hence we have \verb!\ShowCube{1.6cm}{0.4}{...}!.
+
+\end{enumerate}
+
+
+
+\pagebreak
+%----------------------
+\subsection{Three-edge cycle}
+\typeout{---Example (three-edge cycle)}
+
+
+The following example shows a sequence often used in solving the final layer.
+ The black (no flip) and magenta (flip) arrows indicate the \upface\
+cubie movement associated with the `three-edge cycle sequence
+\ShowSequence{,}{\rr}{F,R,U,Rp,Up,Fp}. The blue arrows indicate so-called
+collateral damage (two pairs of corner cubies swap positions) which can be fixed
+at a later stage. (This diagram is from Section~13 in the
+\textsc{rubikcube} package documentation).
+
+ \bigskip%
+ \noindent\hfil%
+ \RubikCubeSolved%
+ \ShowCube{1.6cm}{0.4}{\DrawRubikCubeRU}%
+ \quad\ShowCube{1.6cm}{0.4}{%
+ \DrawFlatUpSide%
+ \draw[thick,->,color=magenta] (1.5,0.5) -- (2.4, 1.4);
+ \draw[thick,->] (2.5,1.5) -- (1.6, 2.4);
+ \draw[thick,->,color=magenta] (1.3, 2.3) -- (1.3, 0.5);
+ \draw[thick,<->, color=blue] (0.5,2.6) -- (2.5, 2.6);
+ \draw[thick,<->, color=blue] (0.5,0.3) -- (2.5, 0.3);
+ }%
+ \RubikRotation{F,R,U,Rp,Up,Fp}%
+ \quad\ShowSequence{}{\Rubik}{\SequenceLong}\quad$\longrightarrow$\quad%
+ \ShowCube{1.6cm}{0.4}{\DrawFlatUpSide}%
+ \hfil%
+
+ \bigskip%
+
+
+{\noindent}The code for the figure is as follows
+
+
+\begin{verbatim}
+ \bigskip%
+ \noindent\hfil%
+ \RubikCubeSolved%
+ \ShowCube{1.6cm}{0.4}{\DrawRubikCubeRU}%
+ \quad\ShowCube{1.6cm}{0.4}{%
+ \DrawFlatUpSide%
+ \draw[thick,->,color=magenta] (1.5,0.5) -- (2.4, 1.4);
+ \draw[thick,->] (2.5,1.5) -- (1.6, 2.4);
+ \draw[thick,->,color=magenta] (1.3, 2.3) -- (1.3, 0.5);
+ \draw[thick,<->, color=blue] (0.5,2.6) -- (2.5, 2.6);
+ \draw[thick,<->, color=blue] (0.5,0.3) -- (2.5, 0.3);
+ }%
+ \RubikRotation{F,R,U,Rp,Up,Fp}%
+ \quad\ShowSequence{}{\Rubik}{\SequenceLong}\quad$\longrightarrow$\quad%
+ \ShowCube{1.6cm}{0.4}{\DrawFlatUpSide}%
+ \hfil%
+
+ \bigskip
+\end{verbatim}
+
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Superflip}
+\typeout{---Example (subperflip)}
+
+
+Once you can solve Rubik's cube, then an interesting exercise is to generate
+the so-called `superflip' configuration, in which all the
+corners are correctly solved, while all the edges are
+flipped\,\footnote{See the `superflip' entry in \textit{Wikipedia}, and also
+the Kociemba website (\url{www.kociemba.org/cube.htm}); particularly the page
+\url{http://kociemba.org/math/oh.htm}}.
+
+%--------draw the images-------------
+\begin{figure}[hbt]
+ \centering
+ \RubikCubeSolved
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
+ \quad$\longrightarrow$\quad%
+ \RubikRotation{\superflip}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeLD}
+ \quad\quad%
+ \ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
+\caption{Two representations of the superflip configuration.}
+\end{figure}
+%----------------------
+
+{\noindent}A superflip sequence converts the solved cube on the left
+into the form on the right, using the command \verb!\RubikRotation{\superflip}!.
+The full code for the above figure is as follows:
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
+...
+\begin{figure}[hbt]
+ \centering
+ \RubikCubeSolved
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
+ \quad$\longrightarrow$\quad%
+ \RubikRotation{\superflip}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeLD}
+ \quad\quad%
+ \ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
+\caption{...}
+\end{figure}
+\end{verbatim}
+
+
+The following superflip sequence\,\footnote{This particular superflip sequence
+(in the \textsc{rubikpatterns} package) is due to Reid (1995);
+for details see the \textsc{rubikpatterns} package
+documentation, and also \url{http://kociemba.org/math/oh.htm}.
+Another 20-move superflip sequence (due to H Kociemba), is designated as K32466
+ in \url{www.nickalls.org/dick/papers/tex/RUBIK20moves.zip}.}
+has just 20 HTM rotations (Half Turn Metric: counting 180~degree turns as just
+one `rotation'). Note that the \textsc{rubikpatterns} package contains this particular
+superflip sequence as the macro \verb!\superflip!
+(see \texttt{rubikpatterns.pdf}). Consequently the code
+\verb!\ShowSequence{,}{\large\texttt}{\superflip}!, will typeset the sequence
+as follows:
+
+\begin{center}
+%% show the Short code
+\ShowSequence{,}{\texttt}{\superflip}
+\end{center}
+Note that for convenience, the \textsc{rubikpatterns} package includes the sequence
+name (in square brackets) as the first element of the associated macro.
+This is possible since the contents of a comma-separated square bracket is not
+actioned as a rotation when it appears as part of the argument of
+the \verb!\RubikRotation! command.
+
+\pagebreak
+
+Next we present the sequence without commas in the form of hieroglyphs using
+the \verb!\Rubik! font, for which we require the `expanded' \verb!\SequenceLong!
+form (since the `short form' includes trailing digits---see \S\,9 in
+\texttt{rubikcube.pdf}), using the code
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
+...
+\RubikCubeSolved
+\RubikRotation{\superflip}
+\noindent\strut\hspace{-8mm}\ShowSequence{}{\Rubik}{\SequenceLong}
+\end{verbatim}
+\end{quote}
+which gives
+
+
+\bigskip
+
+\RubikCubeSolved
+\RubikRotation{\superflip}
+\noindent\strut\hspace{-8mm}\ShowSequence{}{\Rubik}{\SequenceLong}
+
+
+%%---------------------------------
+\bigskip
+
+\subsubsection*{Equivalent sequence}
+
+
+Interestingly, the superflip sequence is actually equivalent to
+\Rubikbrace{\Rubikbracket{\Rubik{Rmp}\Rubik{Up}}4, \Rubik{yp}, \Rubik{x}}3.
+Furthermore we can readily demonstrate this, as we can process this novel form
+of the sequence using some useful features of the \verb!\RubikRotation!
+command, as follows:
+
+\begin{quote}
+\begin{verbatim}
+\RubikCubeSolved%
+\RubikRotation[3]{[superflip],(Rmp,Up)4,yp,x}%
+\ShowCube{4cm}{0.4}{\DrawRubikCubeSF}%
+\end{verbatim}
+\end{quote}
+which generates the following
+
+%-------------------
+\begin{figure}[hbt]
+ \centering
+ \RubikCubeSolved%
+ \RubikRotation[3]{[shortsuper],(Rmp,Up)4,yp,x}%
+ \ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
+\end{figure}
+%----------------------
+{\noindent}which is exactly the same configuration as before.
+Note that to do this we had to make use of the `repeat' option \verb![3]!
+as well as the \verb!(Rmp,Up)4! `repeat-block' in
+the argument of the \verb!\RubikRotation! command above.
+
+
+
+
+\pagebreak
+%----------------------
+\subsection{Inverse sequence}
+\typeout{---Example (inverse sequence)}
+
+
+Generating the inverse of a Rubik sequence involves (a)~reversing the order of
+the sequence, and (b)~inverting each rotation in the sequence
+(see Sections~5.1 and 5.11 in the \textsc{rubikrotation} package documentation).
+
+
+From the grey-cube example~(\ref{sec:greycube}) we saw that the sixspot sequence is: \verb!U,Dp,R,Lp,F,Bp,U,Dp!;
+its inverse is therefore readily determined as \verb!D,Up,B,Fp,L,Rp,D,Up!.
+Note that this is easy to check since the sequence generated by the
+\verb!\RubikRotation! command is held by the macro \verb!\SequenceLong!.
+For~example, the output of the following commands
+\begin{quote}
+\begin{verbatim}
+\fbox{\strut\ %
+The inverse of the sixspot sequence is:
+\RubikRotation{\sixspot,<inverse>}
+\ShowSequence{,}{\texttt}{\SequenceLong}.
+}
+\end{verbatim}
+\end{quote}
+is \quad\fbox{\strut\ %
+The inverse of the sixspot sequence is:
+\RubikRotation{\sixspot,<inverse>}
+\ShowSequence{,}{\texttt}{\SequenceLong}.
+}
+
+\bigskip
+
+A sequence and its inverse will annihilate each other when applied consecutively.
+For example, in the following figure we start with a solved cube and
+apply the sixspot sequence. Applying the inverse of the sixspot sequence then
+results in the solved cube configuration again.
+
+\newcommand{\sixspotINV}{[sixspotINV],D,Up,B,Fp,L,Rp,D,Up}
+\newcommand{\sixspotarrow}{$\quad\overrightarrow{\strut\textsc{sixspot}}\quad$}
+\newcommand{\sixspotINVarrow}{$\quad\overrightarrow{\strut\textsc{sixspotINV}}\quad$}
+
+\begin{figure}[hbt]
+\centering
+\RubikCubeSolved%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotarrow%
+\RubikRotation{\sixspot}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotINVarrow%
+\RubikRotation{\sixspotINV}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
+\end{figure}
+
+{\noindent}The code for the above figure is as follows:
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
+...
+\newcommand{\sixspotINV}{[sixspotINV],D,Up,B,Fp,L,Rp,D,Up}
+\newcommand{\sixspotarrow}{$\quad\overrightarrow{\strut\textsc{sixspot}}\quad$}
+\newcommand{\sixspotINVarrow}{$\quad\overrightarrow{\strut\textsc{sixspotINV}}\quad$}
+
+\begin{figure}[hbt]
+\centering
+\RubikCubeSolved%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotarrow%
+\RubikRotation{\sixspot}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotINVarrow%
+\RubikRotation{\sixspotINV}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
+\end{figure}
+\end{verbatim}
+\end{quote}
+
+\pagebreak
+
+A significant property of the superflip configuration is that it is its own inverse.
+Consequently we can achieve a similar result simply by applying the
+superflip sequence \textit{twice in succession}, as follows:
+
+\newcommand{\superfliparrow}{$\quad\overrightarrow{\strut\textsc{superflip}}\quad$}
+
+
+\begin{figure}[hbt]
+\centering
+\RubikCubeSolved%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\superfliparrow%
+\RubikRotation{\superflip}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\superfliparrow%
+\RubikRotation{\superflip}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
+\end{figure}
+
+
+
+
+\begin{center}
+------ END ------
+\end{center}
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatterns-doc-figA.pdf b/Master/texmf-dist/doc/latex/rubik/rubikpatterns-doc-figA.pdf
new file mode 100644
index 00000000000..bcf34e0cdde
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatterns-doc-figA.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf b/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf
new file mode 100644
index 00000000000..053ffaa6822
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf
new file mode 100644
index 00000000000..f80c1f7344a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh
new file mode 100644
index 00000000000..8e101ad176d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh
@@ -0,0 +1,9 @@
+
+## rubikpatternsLIST.sh
+## run twice to get hyperref-links correct
+
+ pdflatex --shell-escape rubikpatternsLIST.tex
+ pdflatex --shell-escape rubikpatternsLIST.tex
+
+## echo "...checking error file"
+## grep ERROR ./rubikstateERRORS.dat
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex
new file mode 100644
index 00000000000..fc7a677b51d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex
@@ -0,0 +1,305 @@
+%% rubikpatternsLIST.tex
+%% part of the rubikpatterns package v 4.0
+%% authors: RWD Nickalls & A Syropoulos
+%% 03 March 2017
+%%------------------------
+%% this file uses the rubikrotation package
+%% run this file as : $ pdflatex --shell-escape rubikpatternsLIST.tex
+%%------------------------
+
+\documentclass[a4paper]{article}
+
+%------LUA-----------
+\usepackage{ifluatex}
+
+\ifluatex
+ \usepackage{shellesc} %% for use with LUAlatex
+ \usepackage{fontspec}
+\else
+\fi
+%--------------------
+
+
+\usepackage{tikz}
+\usepackage{rubikcube}
+\usepackage{rubikrotation}
+\usepackage{rubikpatterns}
+%--------------------------
+\usepackage{url,ifpdf}
+%---------------------
+\ifpdf
+ \usepackage[verbose]{microtype}
+ \usepackage{cmap}
+ \usepackage[pdfencoding=auto]{hyperref}
+
+ \hypersetup{%
+ pdftitle={rubikpatternsLIST.pdf},
+ pdfsubject={Rubik cube, Rubik bundle},
+ pdfkeywords={Rubik cube LaTeX}
+ }
+\fi
+%%-------------------
+%-------------
+\pagestyle{myheadings}
+\markright{\texttt{rubikpatternsLIST.pdf} \ \
+(Rubik bundle v4.0, March 03, 2017) }
+%-------------------------------------
+\newcommand{\ShowPattern}[1]{%
+\noindent%
+ \RubikCubeSolvedWB
+ \RubikRotation{#1}
+ \ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}
+ \hspace{0.5cm}% was 1cm
+\begin{minipage}{9cm}
+\noindent\ShowSequence{,\ }{\texttt}{\SequenceShort},
+\newline\noindent\texttt{\SequenceInfo}.
+\end{minipage}
+}
+%-------------------------
+
+
+
+%======================
+\begin{document}
+
+
+\ifpdf\pdfbookmark[1]{Title}{Title}\fi
+\title{List of Rubik patterns\\%
+\smallskip\normalsize\texttt{www.ctan.org/tex-archives/macros/latex/contrib/rubik/rubikpatternsLIST.pdf}%
+\footnote{This file is part of the Rubik bundle. To generate this file,
+use the following command:
+\newline \texttt{\$ pdflatex --shell-escape rubikpatternsLIST.tex}}}
+\author{RWD Nickalls\,\footnote{email: \textsf{dick@nickalls.org}}%
+ \ \ \& A Syropoulos\,\footnote{email: \textsf{asyropoulos@yahoo.com}}}
+\date{March 03, 2017 (v4.0)}
+\maketitle
+
+
+%==========================================
+\section{Rubik patterns}
+
+
+
+A Rubik pattern is the configuration generated by a sequence of rotations
+(or `moves') from some initial starting configuration (typically a `solved'
+configuration). For example, `sixspot' is a well known pattern generated from
+a solved Rubik cube by the rotation sequence \texttt{U,Dp,R,Lp,F,Bp,U,Dp}, as follows:
+
+
+\bigskip
+
+\noindent\hfil%
+\RubikCubeSolvedWB
+\ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}%
+\RubikRotation{\sixspot}%
+\quad\SequenceBraceA{sixspot}{\ShowSequence{}{\Rubik}{\SequenceLong}}\quad%
+\ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}%
+\hfil%
+
+\bigskip
+
+
+\medskip
+{\noindent}The code for this image is as follows:
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz}
+\usepackage{rubikcube,rubikrotation,rubikpatterns}
+...
+\noindent\hfil%
+\RubikCubeSolvedWB%
+\ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}%
+\RubikRotation{\sixspot}%
+\quad\SequenceBraceA{sixspot}{%
+ \ShowSequence{}{\Rubik}{\SequenceLong}%
+ }%
+\quad\ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}%
+\hfil%
+\end{verbatim}
+\end{quote}
+
+
+Note that the appearance of a pattern generated by a given rotation sequence is,
+of course, sensitive to (a)~the particular colour configuration of the solved
+cube used, and (b)~the initial orientation of the cube.
+
+
+The initial condition associated with all the pattern images shown in this
+document is the solved form of the `WB' colour configuration
+(White opposite Blue), since this is the solved cube colour configuration used
+by the Reid website, from which nearly all these patterns are drawn.
+
+
+The following image shows the WB cube form (set up using the command
+\verb!\RubikCubeSolvedWB!) displayed in a semi-flat (SF) mode
+(\verb!\DrawRubikCubeSF!) so we can see all the faces
+---see the \textsc{rubikcube} documentation for details.
+
+\bigskip
+
+ \RubikCubeSolvedWB%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeSF}%
+
+\medskip
+{\noindent}The code for this image is as follows:
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{tikz}
+\usepackage{rubikcube,rubikrotation}
+...
+\RubikCubeSolvedWB%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeSF}%
+\end{verbatim}
+\end{quote}
+
+
+
+
+
+\section{Typesetting}
+
+The remainder of this document just displays the various patterns made available
+ with the \textsc{rubikpatterns} package.
+We display the patterns using the following \verb!\ShowPattern! command, which
+uses the \verb!\RubikRotation! command (from the \textsc{rubikrotation} package),
+and takes the pattern macro-name as the argument:
+This command draws the cube from the right-upper (RU) viewpoint, and shows the
+rotation sequence and metadata.
+
+\begin{verbatim}
+%----------------------------------------
+\usepackage{tikz}
+\usepackage{rubikcube,rubikrotation,rubikpatterns}
+...
+\newcommand{\ShowPattern}[1]{%
+\noindent%
+ \RubikCubeSolvedWB
+ \RubikRotation{#1}
+ \ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}
+ \hspace{0.5cm}%
+\begin{minipage}{9cm}
+\noindent\ShowSequence{,\ }{\texttt}{\SequenceShort},
+\newline\noindent\texttt{\SequenceInfo}.
+\end{minipage}
+}
+%------------------------------------------
+\end{verbatim}
+
+\pagebreak
+
+For example, the first pattern below (Pons Asinorum) is typeset using the following
+command:
+
+\begin{verbatim}
+\bigskip\ShowPattern{\ponsasinorum}
+\end{verbatim}
+
+
+%-----------------------------
+\section{List of Patterns}
+
+\bigskip\ShowPattern{\PonsAsinorum}
+
+\bigskip\ShowPattern{\CheckerboardsThree}
+
+\bigskip\ShowPattern{\CheckerboardsSix}
+
+\bigskip\ShowPattern{\Stripes}
+
+\bigskip\ShowPattern{\CubeInCube}
+
+\bigskip\ShowPattern{\CubeInCubeInCube}
+
+\bigskip\ShowPattern{\ChristmasCross}
+
+\bigskip\ShowPattern{\PlummersCross}
+
+\bigskip\ShowPattern{\Anaconda}
+
+\bigskip\ShowPattern{\Python}
+
+\bigskip\ShowPattern{\BlackMamba}
+
+\bigskip\ShowPattern{\GreenMamba}
+
+\bigskip\ShowPattern{\FemaleRattlesnake}
+
+\bigskip\ShowPattern{\MaleRattlesnake}
+
+\bigskip\ShowPattern{\FemaleBoa}
+
+\bigskip\ShowPattern{\MaleBoa}
+
+\bigskip\ShowPattern{\FourSpot}
+
+\bigskip\ShowPattern{\sixspot}
+
+\bigskip\ShowPattern{\OrthogonalBars}
+
+\bigskip\ShowPattern{\SixTs}
+
+\bigskip\ShowPattern{\SixTwoOne}
+
+\bigskip\ShowPattern{\ExchangedPeaks}
+
+\bigskip\ShowPattern{\TwoTwistedPeaks}
+
+\bigskip\ShowPattern{\FourTwistedPeaks}
+
+\bigskip\ShowPattern{\ExchangedChickenFeet}
+
+\bigskip\ShowPattern{\TwistedChickenFeet}
+
+\bigskip\ShowPattern{\ExchangedRings}
+
+\bigskip\ShowPattern{\TwistedRings}
+
+\bigskip\ShowPattern{\EdgeHexagonTwo}
+
+\bigskip\ShowPattern{\EdgeHexagonThree}
+
+\bigskip\ShowPattern{\TomParksPattern}
+
+\bigskip\ShowPattern{\RonsCubeInCube}
+
+\bigskip\ShowPattern{\TwistedDuckFeet}
+
+\bigskip\ShowPattern{\ExchangedDuckFeet}
+
+\bigskip\ShowPattern{\Superflip}
+
+\bigskip
+
+
+%------------------------
+\section{References}
+
+\begin{itemize}
+\item Fridrich website (Fridrich J). \ \ \url{http://www.ws.binghamton.edu/fridrich/}
+See the `Pretty patterns' webpage
+\url{http://www.ws.binghamton.edu/fridrich/ptrns.html}
+
+
+
+\item Kociemba website (Kociemba H). \url{http://www.kociemba.org/cube.htm}
+ {\newline}---for superflip see: \url{http://www.kociemba.org/math/oh.htm}
+
+
+
+\item Randelshofer website (Randelshofer W). Pretty patterns. \url{http://www.randelshofer.ch/rubik/patterns/U080.01.html}
+
+
+
+\item Reid patterns web page (Reid M).
+\url{http://www.cflmath.com/~reid/Rubik/patterns.html}
+
+\end{itemize}
+
+
+\begin{center}
+------ END ------
+\end{center}
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figA.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figA.pdf
index b3992299158..b3992299158 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figA.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figA.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figB.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figB.pdf
index 7478436a27f..7478436a27f 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figB.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figB.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figC.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figC.pdf
index 7ca1fe2db2d..7ca1fe2db2d 100644
--- a/Master/texmf-dist/doc/latex/rubik/Rubikrot-doc-figC.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figC.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figD.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figD.pdf
new file mode 100644
index 00000000000..8cda23314e5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrot-doc-figD.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotation.1 b/Master/texmf-dist/doc/latex/rubik/rubikrotation.1
index bfcec061deb..c3c8c655b02 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotation.1
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrotation.1
@@ -1,40 +1,41 @@
-.\" copyright (c) 2015 A Syropoulos and RWD Nickalls
+.\" copyright (c) 2014--2017 A Syropoulos and RWD Nickalls
.\" rubikrotation.1
.\" place this file in: /usr/share/man/man1/
..
.TH rubikrotation.1
.SH NAME
-.B rubikrotation (v3.0)
+.B rubikrotation (v4.0)
.SH AUTHORS
-A. Syropoulos and R.W.D. Nickalls (September 25, 2015)
+A. Syropoulos and R.W.D. Nickalls (3rd March 2017)
- asyropoulos[at]<yahoo><com>
dick[at]<nickalls><org>
+ asyropoulos[at]<yahoo><com>
+
.SH DESCRIPTION
.B rubikrotation
is a Perl script for processing Rubik cube rotations. It is part of the LaTeX rubikrotation package, and is typically CALLed by rubikrotation.sty. See the package manual for full details (type at the commandline: texdoc rubikrotation). Both the rubikrotation and rubikcube packages are part of the LaTeX Rubik `bundle'. The latest version can be downloaded from
.PP
-CTAN: tex-archive/tex/latex/contrib/rubik/
+CTAN: mirror.ctan.org/macros/latex/contrib/rubik/
.PP
rubikrotation reads Rubik configuration data and instructions from an input file, and writes the new configuration data to an output file. The input and output filenames can be specified as command-line arguments (see: command-line use).
.SH COMMAND-LINE USE
-rubikrotation [-h] [-o <outfile>] -i <infile>
+rubikrotation [-h|--help|-v|--version] [-o <outfile>] -i <infile>
.B -h
displays the help info and exits.
.B -i
defines the input filename.
-Typically the file rubikstate.dat which is generated by the LaTeX RubikRotation{} command.
+The default input filename set by the rubikrotation package is rubikstate.dat, and this is generated by the LaTeX RubikRotation{} command (see the rubikrotation LaTeX package manual rubikrotation.pdf). Note that the rubikrotation perl script expects the input file to have a certain structure, as described in rubikrotation.pdf and rubikrotationPL.pdf).
.B -o
defines the output filename.
If no output filename is given then the default filename rubikOUT.txt is used.
.SH SEE ALSO
-The rubikrotation package manual (rubikrotation.pdf) and examples, and also the rubikcube package manual (rubikcube.pdf)
+The rubikrotation Perl script manual (rubikrotationPL.pdf), the rubikrotation LaTeX package manual (rubikrotation.pdf), examples (rubikexamples.pdf), the rubikcube LaTeX package manual (rubikcube.pdf), and the rubikpatterns LaTeX package manuals (rubikpatterns.pdf and rubikpatternsLIST.pdf).
To view rubikrotation.pdf, type: texdoc rubikrotation
@@ -42,6 +43,11 @@ To view rubikrotationPL.pdf, type: texdoc rubikrotationPL
To view rubikcube.pdf, type: texdoc rubikcube
+To view rubikexamples.pdf, type: texdoc rubikexamples
+
+To view rubikpatterns.pdf, type: texdoc rubikpatterns
+
+To view rubikpatternsLIST.pdf, type: texdoc rubikpatternsLIST
.SH BUGS
Please report bugs to Dick Nickalls or to Apostolos Syropoulos.
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf
index d38932f4d62..13274cb9571 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf
index 0dc64ac5426..0065929b066 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.tex b/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.tex
deleted file mode 100644
index 8377aa25a07..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.tex
+++ /dev/null
@@ -1,1333 +0,0 @@
-%% rubikrotationPL.tex (v3.0)
-%% Sept 25, 2015
-%% document the perl program rubikrotation.pl
-%%********************************************
-%% use pdf only to get the landscape version
-%% remember to manually adjust long lines in the writestate sub
-%%********************************************
-
-\documentclass[a4paper]{article}
-
-\usepackage{url,ifpdf}
-
-%% need to widen the page for the code
-\addtolength{\textwidth}{4cm}
-\addtolength{\oddsidemargin}{-2cm}
-%-----------------------------
-%% use pdflatex only (to use landscape)
-\ifpdf
- \usepackage{pdflscape} %% landscape environment
- \usepackage[verbose]{microtype} %% pdftex nicer margin alignment
- \usepackage{cmap} %% make the pdf searchable
- %% use hyperref
- \usepackage[pdfencoding=auto]{hyperref}
- \hypersetup{%%% pdftex,
- bookmarksopen=true,
- bookmarksnumbered=true,
- bookmarkstype=toc,
- bookmarksopenlevel=2, %% (book=0, chap=1, article=2)
- %---------------------
- pdftitle={Documentation of rubikrotation.pl.},
- pdfauthor={RWD Nickalls and A Syropoulos},
- pdfsubject={Rubik, rubikrotation},
- pdfkeywords={TeX, Rubik, Rubikrotation},
- }
-\fi
-
-\begin{document}
-
-
-\title{\vspace{-3cm}%
- \ifpdf\pdfbookmark[0]{Title}{Title}\else\fi%
- %% \strut\vspace{\baselineskip}%
- Documentation of \texttt{rubikrotation.pl}\\ version~3.0}
-\author{Nickalls RWD (\textsf{dick@nickalls.org})\\
- and\\ Syropoulos A (\textsf{asyropoulos@yahoo.com})}
-\date{Last revised: 25 September 2015\\ \smallskip this file: \texttt{rubikrotationPL.tex}}
-\maketitle
-
-\tableofcontents
-\ifpdf\pdfbookmark[0]{Contents}{Contents}\else\fi
-
-\section{Overview}
-
-This Perl program, is part of the \LaTeX\ \textsf{rubikrotation} package.
-The two packages Rubikcube and Rubikrotation form the `Rubik bundle'
-(available from \url{http://www.ctan.org/pkg/rubik}).
-
-This program reads (as input) a formatted `data' file (typically the file \texttt{rubikstate.dat} when used with
-the rubikcube package). The data-file defines the
-current state of the cube (using the keywords up, down, left, right, front, back),
-and includes special keywords (checkstate, rotation, random) which trigger the relevant
- subroutines to process the input data accordingly. Finally, the program writes the final state to
-a text-file (typically the file \texttt{rubikstateNEW.dat} when used with the Rubikcube package),
- and writes any error messages to the file \texttt{rubikstateERRORS.dat}.
-
-Version 3 onwards uses the input and output filenames specified by the CALLing command-line,
-the usage being as follows:
-\begin{verbatim}
-rubikrotation -i <input file> [-o <out file>]
-\end{verbatim}
-If no output filename is specified, then the default filename \texttt{rubikOUT.txt} is used.
-When used in conjunction with the Rubikcube package, then \texttt{rubikcube.sty} calls the program and sets
-the input filename as \texttt{rubikstate.dat} and the output filename as \texttt{rubikstateNEW.dat}.
-
-%%================================
-\begin{landscape}
-
-\section{The code}
-\begin{verbatim}
-#!/usr/bin/env perl
-##
-use Carp;
-use Fatal;
-use warnings;
-##
-our $version = "3.0 (25 Sept 2015)";
-##---------------------------
-##
-## rubikrotation.pl
-## VERSION 3.0
-## Copyright 25 September, 2015,
-## RWD Nickalls (dick@nickalls.org}
-## A Syropoulos (asyropoulos@yahoo.com)
-##
-##--------------------------------
-## changes in v3.0:
-## 1) accepts command-line arguments for input (mandatory) and output (optional) filenames
-## default output filename is: rubikOUT.txt
-## 2) included the symbols [ and ] to denote a rotation-name label (ie as well as *)
-## 3) fixed some of the variable definitions (as highlighted by <use strict> pragma)
-##--------------------------------
-## changes in v2.3:
-## 1) accepts a single commandline argument (datafilename)
-## 2) uses the standard modules Carp and Fatal (give extra line info on error)
-##--------------------------------
-## changes in v2.2:
-## 1) changed licence --> LatexPP
-## 2) included random n errors in ERROR messages (lines 492--495)
-## 3) included version number in error message
-##------------------------------
-##
-## This file is part of the LaTeX rubikrotation package, and
-## requires rubikcube.sty and rubikrotation.sty
-##
-## rubikrotation.pl is a Perl-5 program and free software:
-## This program can be redistributed and/or modified under the terms
-## of the LaTeX Project Public License Distributed from CTAN
-## archives in directory macros/latex/base/lppl.txt; either
-## version 1 of the License, or any later version.
-##
-## rubikrotation.pl is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-##---------------------------------------------------------------------
-## OVERVIEW
-## This program is part of the rubikrotation package, and is complementary to
-## the LaTeX rubikcube package. It processes Rubik rotation sequences on-the-fly.
-## The program reads a datafile (rubikstate.dat) output by the rubikcube package
-## and writes the new state to the file rubikstateNEW.dat, which is then input
-## by the TeX file. Further documentation accompanies the rubikrotation package.
-##
-## Note that all possible state changing rotations of a 3x3x3 cube are
-## either combinations of, or the inverse of, just 9 different rotations,
-## three associated with each XYZ axis.
-##--------------------------------------------------
-\end{verbatim}
-
-
-
-\subsection{Main}
-
-\begin{verbatim}
-\begin{verbatim}
-## This main module opens three files, and
-## sets up an array for collecting all errors (%error), and sets an error flag to "",
-## reads in the rubik state data file =rubikstate.dat (output by TeXfile),
-## and calls subs to write the TeX_OUT_FILE,
-## and finally closes all files.
-## Each line of the input file consists of a comma separated list of arguments.
-## The first argument in each line of the file rubikstate.dat is the rubikkeyword.
-## Program is documented in the rubikrotation.pdf (see section ``Overview'')
-
-our $source_file="";
-our $out_file="rubikOUT.txt"; #default
-our $argc=@ARGV;
-our $commandLineArgs = join(" ", @ARGV);
-our $showargs="\tcommandline args = $commandLineArgs\n";
-our $usage="\tUsage: rubikrotation [-h|--help|-v|--version] -i <input file> [-o <out file>]\n";
-our $rubikversion="\tVersion: this is rubikrotation version $version\n";
-#
-## check for correct number of commandline arguments and allocate filenames
-#
-if ($argc == 0||$argc > 4 ){ # croak if 0 or more than 4 arguments
- croak $rubikversion,$showargs,
- "\tWrong no of arguments\n",
- $usage;
- }
- else {
- SWITCHES:
- while($_ = $ARGV[0]) {
- shift;
- if (/^-h$/ || /^--help$/ ) {
- die $rubikversion,$usage,
- "\twhere,\n" .
- "\t[-h|--help]\tgives this help listing\n" .
- "\t[-v|--version]\tgives version\n" .
- "\t[-i] \tcreates specified input file\n",
- "\t[-o] \tcreates specified output file\n",
- "\tFor documentation see: rubikrotation.pdf,\n",
- "\trubikrotationPL.pdf and rubikcube.pdf.\n\n";
- }
- elsif (/^-v$/ || /^--version$/ ) {die $rubikversion;}
- elsif (/^-i$/) {
- if (!@ARGV){
- croak $showargs,
- "\tNo input file specified!\n",
- $usage;
- }
- else {
- $source_file = $ARGV[0],
- shift;
- }
- }
- elsif (/^-o$/) {
- if (!@ARGV) {
- croak $showargs,
- "\tNo output file specified!\n",
- $usage;
- }
- else {
- $out_file = $ARGV[0],
- shift;
- }
- }
- elsif (/^-\w+/) {
- croak $showargs,
- "\t$_: Illegal command line switch!\n",
- $usage;
- }
- else {
- croak $showargs,
- "\tmissing filenames or ? missing -i or -o switch!\n",
- $usage;
- }
- } # end of while
-}; # end of else
-
-print "This is rubikrotation version $version\n";
-#================================
- open(IN_FILE, "<$source_file") ||croak "\tCan't open source file: $source_file\n";
- open(TeX_OUT_FILE, ">$out_file")||croak "\tCan't open output file: $out_file\n";
-
- ## create error file (for append)
- open (ERROR_OUT_FILE, ">>rubikstateERRORS.dat")||croak "ERROR: can't open file rubikstateERRORS.dat\n";
-
-
- ## use dots for Perl messages (I have used dashes for LaTeX messages in the .sty)
- ## gprint sub prints its argument (message) to both the screen and to the TeX_OUT_FILE
-
- gprint ("...PERL process..................................");
- gprint ("...program = rubikrotation.pl v$version");
-
-## setup global error parameters, so we can write all the errors to a file as an array
-my %error = (); # setup an array for error messages (was %)
-my $erroralert = ""; # error flag
-my $errornumber = 0; #set number of errors to zero
-
- gprint ("...reading the current rubik state (from File: $source_file)");
-
-my $dataline = "";
-my $rubikkeyword = "";
-my $rotationcommand = "";
-my @data;
-
- LINE: while (<IN_FILE>){
- next LINE if /^#/; #skip comments
- next LINE if /^%/; #skip comments
- next LINE if /^$/; #skip blank lines
- $dataline = $_; # grab the whole line as a string
- chomp $dataline; # remove the line-ending characters
- #$n++; # count the number of lines
- @data=split (/,/, $dataline); # create an array called data
- ## we have 10 fields (0--9)
- ## check for rubikkeyword= up,down,left,right,front,back,checkstate,rotation:
- gprint ("...$dataline");
- $rubikkeyword=$data[0];
-
- if ($rubikkeyword eq 'up') {
- $Ult[0]=$data[1], $Umt[0]=$data[2],$Urt[0]=$data[3],
- $Ulm[0]=$data[4], $Umm[0]=$data[5],$Urm[0]=$data[6],
- $Ulb[0]=$data[7], $Umb[0]=$data[8],$Urb[0]=$data[9]
- }
-
- if ($rubikkeyword eq 'down') {
- $Dlt[0]=$data[1], $Dmt[0]=$data[2],$Drt[0]=$data[3],
- $Dlm[0]=$data[4], $Dmm[0]=$data[5],$Drm[0]=$data[6],
- $Dlb[0]=$data[7], $Dmb[0]=$data[8],$Drb[0]=$data[9]
- }
- if ($rubikkeyword eq 'left') {
- $Llt[0]=$data[1], $Lmt[0]=$data[2],$Lrt[0]=$data[3],
- $Llm[0]=$data[4], $Lmm[0]=$data[5],$Lrm[0]=$data[6],
- $Llb[0]=$data[7], $Lmb[0]=$data[8],$Lrb[0]=$data[9]
- }
- if ($rubikkeyword eq 'right') {
- $Rlt[0]=$data[1], $Rmt[0]=$data[2],$Rrt[0]=$data[3],
- $Rlm[0]=$data[4], $Rmm[0]=$data[5],$Rrm[0]=$data[6],
- $Rlb[0]=$data[7], $Rmb[0]=$data[8],$Rrb[0]=$data[9]
- }
-
- if ($rubikkeyword eq 'front') {
- $Flt[0]=$data[1], $Fmt[0]=$data[2],$Frt[0]=$data[3],
- $Flm[0]=$data[4], $Fmm[0]=$data[5],$Frm[0]=$data[6],
- $Flb[0]=$data[7], $Fmb[0]=$data[8],$Frb[0]=$data[9]
- }
- if ($rubikkeyword eq 'back') {
- $Blt[0]=$data[1], $Bmt[0]=$data[2],$Brt[0]=$data[3],
- $Blm[0]=$data[4], $Bmm[0]=$data[5],$Brm[0]=$data[6],
- $Blb[0]=$data[7], $Bmb[0]=$data[8],$Brb[0]=$data[9]
- }
-
-## if the rubikkeyword is `checkstate' we just check the
-## state and write the output data to a file.
- if ($rubikkeyword eq 'checkstate') {
- gprint ("...");
- $rotationcommand=$dataline; ## used in output message
- gprint ("...command=$rotationcommand");
- checkstate();
- };
-
-## if the rubikkeyword is `rotation' we first check to see if the second argument=random.
-## if so, then we check that the third argument is an integer, if so --> random sub
-## else --> exit line and get next line.
-## finally we write the output data to a file.
-
- if ($rubikkeyword eq 'rotation')
- {
- gprint ("...");
- $rotationcommand=$dataline; ## used in output message
- gprint ("...command=$rotationcommand");
-
-
- ##-----random-----------------
- ## if second argument = random,
- ## THEN we also need to check if third argument is an integer;
- ## if so -->random sub.
- ## if the 3rd argument is NOT an integer then reject line & get next input line
- if ($data[1] eq 'random')
- {
- if ($data[2] =~/\D/) {
- errormessage("[$data[2]] not an integer");
- ## we reject the whole line and look at next line in the file
- next
- }
- else{
- ## data[2] must be an integer (n), so we just do n random rotations
- random($data[2])
- };
- }
- else {
- # the line must be an ordinary rotation sequence line, so send the sequence
- # to the rotation sub, BUT, need to first remove the
- # rubikkeyword `rotation' from the begining of line (array)
- # as we need to send ONLY the sequence string to the rotation sub.
-
- ## remove keyword rotation
- shift (@data);
-
- ## process @data string by the rotation sub
- rotation(@data);
- }
- }
-##-------------------------------
-## place additional keywords here
-##-------------------------------
- }; ## end of while
-
- ## we have finished reading in all the lines from the source file,
- ## and doing all the rotations etc, so we now just write the new cube state
- ## to the output file = TeX_OUT_FILE (so LaTeX can read it)
- writestate();
- close; ##close all files
- exit;
-##==============end of main==========================
-\end{verbatim}
-
-
-%--------------------------
-\subsection{Errormessage}
-
-\begin{verbatim}
-sub errormessage{
-## writes the argument as a standard error message to out file
- my $errormess = $_[0];
- $erroralert = "YES"; ## set error alert flag (for use in out message)
- $error[$errornumber] = "** ERROR: $errormess";
- $errornumber++; ## increment number
-};
-\end{verbatim}
-
-
-%----------------------
-\subsection{Gprint}
-
-\begin{verbatim}
-## prints argument (comments) to screen and also to TeX_OUT_FILE.
-## The typeout commands will find its way into the log file when read by latex
-## Important to include trailing % for messages written to the TeX_OUT_FILE
-## to stop extra <spaces> being seen by TeX.
-sub gprint{
- my $gmess=$_[0];
- print "$gmess\n";
- print (TeX_OUT_FILE "\\typeout{$gmess}\%\n");
- };
-\end{verbatim}
-
-
-
-%------------------------
-\subsection{Checkstate}
-
-\begin{verbatim}
-sub checkstate{
-### simple check to see if wrong no of colours being used etc
-### uses the cubie colours as used by rubikcube package= ROYGBWX
-
- gprint ("...checking state of cube");
-
- my @cubies=($Ult[0],$Umt[0],$Urt[0], $Ulm[0],$Umm[0],$Urm[0], $Ulb[0],$Umb[0],$Urb[0],
- $Dlt[0],$Dmt[0],$Drt[0], $Dlm[0],$Dmm[0],$Drm[0], $Dlb[0],$Dmb[0],$Drb[0],
- $Llt[0],$Lmt[0],$Lrt[0], $Llm[0],$Lmm[0],$Lrm[0], $Llb[0],$Lmb[0],$Lrb[0],
- $Rlt[0],$Rmt[0],$Rrt[0], $Rlm[0],$Rmm[0],$Rrm[0], $Rlb[0],$Rmb[0],$Rrb[0],
- $Flt[0],$Fmt[0],$Frt[0], $Flm[0],$Fmm[0],$Frm[0], $Flb[0],$Fmb[0],$Frb[0],
- $Blt[0],$Bmt[0],$Brt[0], $Blm[0],$Bmm[0],$Brm[0], $Blb[0],$Bmb[0],$Brb[0]);
-
-my $R=0,my $O=0,my $Y=0,my $G=0,my $B=0,my $W=0,my $X=0;
-
-my $cubiecolour = "";
-
-foreach $cubiecolour (@cubies)
- {
- if ($cubiecolour eq R) {$R = $R+1}
- elsif ($cubiecolour eq O) {$O = $O+1}
- elsif ($cubiecolour eq Y) {$Y = $Y+1}
- elsif ($cubiecolour eq G) {$G = $G+1}
- elsif ($cubiecolour eq B) {$B = $B+1}
- elsif ($cubiecolour eq W) {$W = $W+1}
- elsif ($cubiecolour eq X) {$X = $X+1}
- else {print " cubiecolour counting ERROR \n";}
- };
-my $cubiesum=0;
-$cubiesum = $R+$O+$Y+$G+$B+$W+$X;
-gprint ("...cubiesum = $cubiesum (Red=$R, Or=$O, Ye=$Y, Gr=$G, Bl=$B, Wh=$W, X=$X)");
-
-if ($cubiesum != 54) { errormessage("cubiesum not = 54")};
-if ($R >9){ errormessage("No of Red cubies > 9 (=$R)")};
-if ($O >9){ errormessage("No of Orange cubies > 9 (=$O)")};
-if ($Y >9){ errormessage("No of Yellow cubies > 9 (=$Y)")};
-if ($G >9){ errormessage("No of Green cubies > 9 (=$G)")};
-if ($B >9){ errormessage("No of Blue cubies > 9 (=$B)")};
-if ($W >9){ errormessage("No of White cubies > 9 (=$W)")};
-};
-##====================================================
-\end{verbatim}
-
-
-
-%--------------------
-\subsection{Rotation}
-
-\begin{verbatim}
-# no of arguments passed to the sub = $#_ (black book p 156)
-
-sub rotation {
-## here we process the array @data (from main) consisting of all
-## the rotation commands associated with
-## a single RubikRotation command.
-
- my $m; #multiple associated with the char, eg D2 etc
- my $n = ($#_ +1); ##total no of arguments passed
- my $originalchar="";
- my $j;
- my $numberofchars; ## length of a string
- my $nfrontchars;
- my $char = "";
-
- gprint ("...arguments passed to `rotation' sub = @_ (n= $n)");
- foreach $char (@_) {
- $char =~s/^\s+//, $char=~s/\s+$//; ## clean leading and trailing white space
- ## grab a copy of the original char for use if m Mod4=0
- $originalchar=$char;
-
- ## if argument has a leading * or [ or ] then it is a label (not a rotation)
- ## so jump to next one
- if (substr ($char,0,1) =~ /[ * \[ \] ]/ ){
- gprint ("...$char is a label OK");
- next;
- };
-
- ## Need to detect any trailing integer associated with a command (eg rotation multiple, eg:U3, L2 etc)
- ## NOTES: since we are using mod4, we are only interested in trailing digit
- ## if trailing character is a digit, then
- ## split char string into front chars (= $char) + trailing digit (= $m)
- $m = 1; # initialise m
-
- ## if terminal char is a digit (d) then let d --> m and let frontstring --> char
- ## (Black book p 130 & 136)
- ## if the frontstring contains any digits then it will be rejected in the filter below anyway.
-
- if ( substr ($char,-1) =~ /(\d)/)
- {
- $m = $1; ## grab the trailing digit (only traps a single digit)
- $numberofchars = 0; #initialise it
- $numberofchars = length $originalchar;
- $nfrontchars = $numberofchars-1;
- ## reassign the string except the terminal digit
- $char = substr($char,0,$nfrontchars);
- ## use MOD 4 since we are dealing with Rubik rotations
- $m = $m % 4;
- ## (if MOD 4 = 0 then nothing will happen as j starts at 1)
- ## but should generate an errormessage
- if ( $m == 0 ){
- gprint ("...rotation $originalchar equiv 0 (NOT IMPLEMENTED)");
- errormessage ("[$originalchar] in RubikRotation (4 MOD 4 = 0)");
- next;
- };
- };
- ## if single trailing digit present, then we implement the rotation command m times.
- ## if more than one trailing digit
- ## then the error is trapped at the end (as frontstring will not be recognised
- ## ie will not be in the following list, and hence will be trapped as an error, eg R3)
- ##
- if ($char eq "R") {for($j=1;$j<=$m;$j++) { gprint ("...rotation R OK"); &rrR}}
- elsif ($char eq "Rp") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Rp OK (= rrR3)"); &rrRp}}
- elsif ($char eq "Rw") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Rw OK (= rrR + rrSr)"); &rrRw}}
- elsif ($char eq "Rwp") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Rwp OK (= rrRp + rrSrp)"); &rrRwp}}
- elsif ($char eq "Rs") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Rs OK (= rrR + rrLp)"); &rrRs}}
- elsif ($char eq "Rsp") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Rsp OK (= rrRp + rrL)"); &rrRsp}}
- elsif ($char eq "Ra") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Ra OK (= rrR + rrL)"); &rrRa}}
- elsif ($char eq "Rap") {for($j=1;$j<=$m;$j++) { gprint ("...rotation Rap OK (= rrRp + rrLp)"); &rrRap}}
- ####
- elsif ($char eq "L") {for($j=1;$j<=$m;$j++) {gprint ("...rotation L OK (= rrLp3)"); &rrL}}
- elsif ($char eq "Lp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Lp OK"); &rrLp}}
- elsif ($char eq "Lw") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Lw OK (= rrLp3 + rrSrp)"); &rrLw}}
- elsif ($char eq "Lwp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Lwp OK (= rrLp + rrSr)"); &rrLwp}}
- elsif ($char eq "Ls") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Ls OK (= rrL + rrRp)"); &rrLs}}
- elsif ($char eq "Lsp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Lsp OK (= rrLp + rrR)"); &rrLsp}}
- elsif ($char eq "La") {for($j=1;$j<=$m;$j++) {gprint ("...rotation La OK (= rrL + rrR)"); &rrLa}}
- elsif ($char eq "Lap") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Lap OK (= rrLp + rrRp)"); &rrLap}}
- ####
- elsif ($char eq "U") {for($j=1;$j<=$m;$j++) {gprint ("...rotation U OK"); &rrU}}
- elsif ($char eq "Up") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Up OK (= rrU3)"); &rrUp}}
- elsif ($char eq "Uw") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Uw OK (= rrU + rrSu)"); &rrUw}}
- elsif ($char eq "Uwp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Uwp OK (= rrUp + rrSup)"); &rrUwp}}
- elsif ($char eq "Us") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Us OK (= rrU + rrDp)"); &rrUs}}
- elsif ($char eq "Usp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Usp OK (= rrUp + rrD)"); &rrUsp}}
- elsif ($char eq "Ua") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Ua OK (= rrU + rrD)"); &rrUa}}
- elsif ($char eq "Uap") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Uap OK (= rrUp + rrDp)"); &rrUap}}
- ####
- elsif ($char eq "D") {for($j=1;$j<=$m;$j++) {gprint ("...rotation D OK (= rrDp3)"); &rrD}}
- elsif ($char eq "Dp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Dp OK "); &rrDp}}
- elsif ($char eq "Dw") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Dw OK (= rrDp3 + rrSup)"); &rrDw}}
- elsif ($char eq "Dwp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Dwp OK (= rrDp + rrSu)"); &rrDwp}}
- elsif ($char eq "Ds") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Ds OK (= rrD + rrUp)"); &rrDs}}
- elsif ($char eq "Dsp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Dsp OK (= rrDp + rrU)"); &rrDsp}}
- elsif ($char eq "Da") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Da OK (= rrD + rrU)"); &rrDa}}
- elsif ($char eq "Dap") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Dap OK (= rrDp + rrUp)"); &rrDap}}
- ####
- elsif ($char eq "F") {for($j=1;$j<=$m;$j++) {gprint ("...rotation F OK"); &rrF}}
- elsif ($char eq "Fp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fp OK (= rrF3)"); &rrFp}}
- elsif ($char eq "Fw") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fw OK (= rrF + rrSf)"); &rrFw}}
- elsif ($char eq "Fwp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fwp OK (= rrFp + rrSfp)"); &rrFwp}}
- elsif ($char eq "Fs") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fs OK (= rrF + rrBp)"); &rrFs}}
- elsif ($char eq "Fsp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fsp OK (= rrFp + rrB)"); &rrFsp}}
- elsif ($char eq "Fa") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fa OK (= rrF + rrB)"); &rrFa}}
- elsif ($char eq "Fap") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Fap OK (= rrFp + rrBp)"); &rrFap}}
- ####
- elsif ($char eq "B") {for($j=1;$j<=$m;$j++) {gprint ("...rotation B OK (= rrFp3)"); &rrB}}
- elsif ($char eq "Bp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Bp OK"); &rrBp}}
- elsif ($char eq "Bw") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Bw OK (= rrFp3 + rrSfp)"); &rrBw}}
- elsif ($char eq "Bwp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Bwp OK (= rrFp + rrSf)"); &rrBwp}}
- elsif ($char eq "Bs") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Bs OK (= rrB + rrFp)"); &rrBs}}
- elsif ($char eq "Bsp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Bsp OK (= rrBp + rrF)"); &rrBsp}}
- elsif ($char eq "Ba") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Ba OK (= rrB + rrF)"); &rrBa}}
- elsif ($char eq "Bap") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Bap OK (= rrBp + rrFp)"); &rrBap}}
- ####
- elsif ($char eq "Su") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Su OK "); &rrSu}}
- elsif ($char eq "Sup") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sup OK (= rrSu3)"); &rrSup}}
- elsif ($char eq "Sd") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sd OK (= rrSup)"); &rrSd}}
- elsif ($char eq "Sdp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sdp OK (= rrSu)"); &rrSdp}}
- elsif ($char eq "Sl") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sl OK (= rrSrp)"); &rrSl}}
- elsif ($char eq "Slp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Slp OK (= rrSr)"); &rrSlp}}
- elsif ($char eq "Sr") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sr OK"); &rrSr}}
- elsif ($char eq "Srp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Srp OK (= rrSr3)"); &rrSrp}}
- elsif ($char eq "Sf") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sf OK"); &rrSf}}
- elsif ($char eq "Sfp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sfp OK (= rrSf3)"); &rrSfp}}
- elsif ($char eq "Sb") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sb OK (= rrSfp)"); &rrSb}}
- elsif ($char eq "Sbp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sbp OK (= rrSf)"); &rrSbp}}
- ## XYZ stuff
- ## need to include lowercase x,y,x, and also u,d,l,r,f,b equivalents
- elsif ($char eq "X" or $char eq "x" or $char eq "r")
- {for($j=1;$j<=$m;$j++) {gprint ("...rotation $char OK (= rrR + rrSr + rrLp)"); &rrR;&rrSr;&rrLp}}
- elsif ($char eq "Xp" or $char eq "xp" or $char eq "l")
- {for($j=1;$j<=$m;$j++) {gprint ("...rotation $char OK (= rrRp + rrSrp + rrL)");&rrRp;&rrSrp;&rrL}}
- elsif ($char eq "Y" or $char eq "y" or $char eq "u")
- {for($j=1;$j<=$m;$j++) {gprint ("...rotation $char OK (= rrU + rrSu + rrDp)"); &rrU;&rrSu;&rrDp}}
- elsif ($char eq "Yp" or $char eq "yp" or $char eq "d")
- {for($j=1;$j<=$m;$j++) {gprint ("...rotation $char OK (= rrUp + rrSup + rrD)");&rrUp;&rrSup;&rrD}}
- elsif ($char eq "Z" or $char eq "z" or $char eq "f")
- {for($j=1;$j<=$m;$j++) {gprint ("...rotation $char OK (= rrF + rrSf + rrBp)"); &rrF;&rrSf;&rrBp}}
- elsif ($char eq "Zp" or $char eq "zp" or $char eq "b")
- {for($j=1;$j<=$m;$j++) {gprint ("...rotation $char OK (= rrFp + rrSfp + rrB)");&rrFp;&rrSfp;&rrB}}
- ## extras
- elsif ($char eq "M") {for($j=1;$j<=$m;$j++) {gprint ("...rotation M OK (= Sl) "); &rrSl}}
- elsif ($char eq "Mp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Mp OK (= Sr) "); &rrSr}}
- elsif ($char eq "E") {for($j=1;$j<=$m;$j++) {gprint ("...rotation E OK (= Sd) "); &rrSd}}
- elsif ($char eq "Ep") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Ep OK (= Su) "); &rrSu}}
- elsif ($char eq "S") {for($j=1;$j<=$m;$j++) {gprint ("...rotation S OK (= Sf) "); &rrSf}}
- elsif ($char eq "Sp") {for($j=1;$j<=$m;$j++) {gprint ("...rotation Sp OK (= Sb) "); &rrSb}}
- ####
- ## check for missing rotation
- elsif ($char eq "") {for($j=1;$j<=$m;$j++)
- {gprint ("...rotation ,$char, ERROR ? typo or missing rotation"),
- errormessage("[,$char,] in RubikRotation: ? typo or missing rotation")}}
- ####
- ## rotation must be undefined
- else {
- gprint ("...rotation $originalchar NOT KNOWN");
- errormessage("[$originalchar] in RubikRotation\{\}");
- };
- }; # end of foreach
- }; # end of sub
-
-##---------------------------------------------
-## aNOTE we have defined (as rotation SUBs at the end) just 9 primary rotation transforms,
-## rrR, rrSr, rrLp
-## rrU, rrSu, rrDp
-## rrF, rrSf, rrBp
-## and since all the remaining ones are simply combinations of these 9
-## we now define all the other rotation subs in terms of these 9 primary moves.
-## do NOT use multiples here: write each rotation separately
-## -------------
-## derivative subs from R and Sr and Lp
-sub rrRp{&rrR;&rrR;&rrR}; # (=rrR3)
-sub rrRw{&rrR; &rrSr}; # (= rrR + rrSr)
-sub rrRwp{&rrR;&rrR;&rrR; &rrSr;&rrSr;&rrSr}; # (= rrRp + rrSrp)
-sub rrRs{&rrR;&rrLp};
-sub rrRsp{&rrRp;&rrL};
-sub rrRa{&rrR;&rrL};
-sub rrRap{&rrRp;&rrLp};
-####
-sub rrL{&rrLp;&rrLp;&rrLp}; # (= rrLp3)
-sub rrLw{&rrLp;&rrLp;&rrLp;&rrSrp}; # (=rrLp3 + rrSrp)
-sub rrLwp{&rrLp;&rrSr};
-sub rrLs{&rrL;&rrRp};
-sub rrLsp{&rrLp;&rrR};
-sub rrLa{&rrL;&rrR};
-sub rrLap{&rrLp;&rrRp};
-##-------------
-## derivative subs from U
-sub rrUp{&rrU;&rrU;&rrU}; # (=rrU3)
-sub rrUw{&rrU;&rrSu}; #
-sub rrUwp{&rrUp;&rrSup};
-sub rrUs{&rrU;&rrDp};
-sub rrUsp{&rrUp;&rrD};
-sub rrUa{&rrU;&rrD};
-sub rrUap{&rrUp;&rrDp};
-####
-sub rrD{&rrDp;&rrDp;&rrDp}; # (= rrDp3)
-sub rrDw{&rrDp;&rrDp;&rrDp;&rrSup}; # (=rrDp3 + rrSup)
-sub rrDwp{&rrDp;&rrSu};
-sub rrDs{&rrD;&rrUp};
-sub rrDsp{&rrDp;&rrU};
-sub rrDa{&rrD;&rrU};
-sub rrDap{&rrDp;&rrUp};
-##-------------
-## derivative subs from F
-sub rrFw{&rrF; &rrSf}; # (= rrF + rrSf)
-sub rrFp{ &rrF;&rrF;&rrF}; # (=rrF3)
-sub rrFwp{&rrF;&rrF;&rrF; &rrSf;&rrSf;&rrSf}; # (= rrF3 + rrSf3)
-sub rrFs{&rrF;&rrBp};
-sub rrFsp{&rrFp;&rrB};
-sub rrFa{&rrF;&rrB};
-sub rrFap{&rrFp;&rrBp};
-####
-sub rrB{&rrBp;&rrBp;&rrBp}; # (= rrBp3)
-sub rrBw{&rrBp;&rrBp;&rrBp; &rrSfp}; # (=rrBp3 + rrSfp)
-sub rrBwp{&rrBp;&rrSf};
-sub rrBs{&rrB;&rrFp};
-sub rrBsp{&rrBp;&rrF};
-sub rrBa{&rrB;&rrF};
-sub rrBap{&rrBp;&rrFp};
-####
-## bring all the S versions together
-sub rrSup{&rrSu;&rrSu;&rrSu}; # (=rrSu3)
-sub rrSd{&rrSup}; # (=rrSup)
-sub rrSdp{&rrSu}; # (=rrSu)
-sub rrSl{&rrSrp}; # (=rrSrp)
-sub rrSlp{&rrSr}; # (=rrSr)
-sub rrSrp{&rrSr;&rrSr;&rrSr}; # (=rrSr3)
-sub rrSfp{&rrSf;&rrSf;&rrSf}; # (=rrSf3)
-sub rrSb{&rrSfp}; # (=rrSfp)
-sub rrSbp{&rrSf}; # (=rrSf)
-\end{verbatim}
-
-%----------------------
-\subsection{Random}
-
-\begin{verbatim}
-# no of arguments passed to the sub = $#_ (black book p 156)
-# parameters passed = $_[0]
-
-sub random{
-## scramble randomly using n rotations
-## example command = RubikRotation{random,74}
-## if no n given (second argument = ""), then use default n=50
-## if second argument is some string (not integer) then --> ERROR
-##
-## asign numbers to the minimal set of rotations to be used using a hash array list
-## (perl 5 book page 68)
-## ? maybe we should only use the 18 rotations mentioned in Rokicki 2013 paper?
-## but here I have included all the S ones too.
-
-my @rrlist= ("U", "Up", "Su", "Sup",
- "D", "Dp", "Sd", "Sdp",
- "L", "Lp", "Sl", "Slp",
- "R", "Rp", "Sr", "Srp",
- "F", "Fp", "Sf", "Sfp",
- "B", "Bp", "Sb", "Sbp");
-
-my $rrlistnumber=$#rrlist;
-print " rrlistnumber = $rrlistnumber\n";
-# these are numbered 0--$rrlistnumber,
-
-## let default no of random rotations for scrambling = 50
-my $defaultn = 50;
-my $maxn = 200;
-## grab the integer passed from the random() command in main
-my $s = $_[0];
-if ($s >= $maxn) {$s = $maxn;
- gprint ("...WARNING: maximum n = 200");
- errormessage ("random: max n =200 (n=200 was used)")}
- elsif ($s == 0) {$s = $defaultn;
- gprint ("...WARNING: integer = 0 or not given: using default value 50");
- errormessage ("random: n invalid (n=50 was used)")};
-
-my @rr; ## array to hold all the random rotations
-print " randomising the available rotations\n";
-
-
-## set the seed for the randomisation (BlackBook p 235)
-srand;
-
-## now select s numbers at random (with replacement) from range 0--listnumber+1
-## Since we are using int(rand x), and using nos from 0--lastindex number,
-## then max rand vaue = (lastindexnumber -1).99999, the integer of which
-## = (lastindexnumber -1). Therefore we need to use the range 0--(lastindexnumber+1)
-## in order to randomise all posibilities on our list.
-
-my $j;
-
-for ($j = 1; $j <=$s; $j=$j+1)
- {
- my $p= int(rand ($rrlistnumber +1));
- print "Rotation = $p, $rrlist[$p] \n";
- ## push rotation code $rrlist[$p] on to END of array @rr
- push (@rr, $rrlist[$p]);
- };
-
- ## we assume the user is starting from a solved cube (ie use the state given by user)
- gprint ("...scrambling Rubik cube using $s random rotations");
- ## now send the array off to the rotation sub
- rotation(@rr);
-}
-##===================subs==================================
-\end{verbatim}
-
-
-%-----------------------
-\subsection{Writestate}
-
-\begin{verbatim}
-sub writestate{
-## this just writes the final state to the TeX_OUT_FILE (= rubikstateNEW.dat) will be read by latex.
-
-print (TeX_OUT_FILE "\%\% output datafile=$out_file\n");
-print (TeX_OUT_FILE "\%\% PERL prog=rubikrotation version $version\n");
-print (TeX_OUT_FILE "\\typeout{...writing new Rubik state to file $out_file}\%\n");
-print (TeX_OUT_FILE "\\RubikFaceUp\{$Ult[0]\}\{$Umt[0]\}\{$Urt[0]\}\{$Ulm[0]\}\{$Umm[0]\}\{$Urm[0]\}\{$Ulb[0]\}
- \{$Umb[0]\}\{$Urb[0]\}\%\n");
-print (TeX_OUT_FILE "\\RubikFaceDown\{$Dlt[0]\}\{$Dmt[0]\}\{$Drt[0]\}\{$Dlm[0]\}\{$Dmm[0]\}\{$Drm[0]\}\{$Dlb[0]\}
- \{$Dmb[0]\}\{$Drb[0]\}\%\n");
-print (TeX_OUT_FILE "\\RubikFaceLeft\{$Llt[0]\}\{$Lmt[0]\}\{$Lrt[0]\}\{$Llm[0]\}\{$Lmm[0]\}\{$Lrm[0]\}\{$Llb[0]\}
- \{$Lmb[0]\}\{$Lrb[0]\}\%\n");
-print (TeX_OUT_FILE "\\RubikFaceRight\{$Rlt[0]\}\{$Rmt[0]\}\{$Rrt[0]\}\{$Rlm[0]\}\{$Rmm[0]\}\{$Rrm[0]\}\{$Rlb[0]\}
- \{$Rmb[0]\}\{$Rrb[0]\}\%\n");
-print (TeX_OUT_FILE "\\RubikFaceFront\{$Flt[0]\}\{$Fmt[0]\}\{$Frt[0]\}\{$Flm[0]\}\{$Fmm[0]\}\{$Frm[0]\}\{$Flb[0]\}
- \{$Fmb[0]\}\{$Frb[0]\}\%\n");
-print (TeX_OUT_FILE "\\RubikFaceBack\{$Blt[0]\}\{$Bmt[0]\}\{$Brt[0]\}\{$Blm[0]\}\{$Bmm[0]\}\{$Brm[0]\}\{$Blb[0]\}
- \{$Bmb[0]\}\{$Brb[0]\}\%\n");
-
-## now include any error messages generated
-## (these are all in an array waiting to be printed out)
-
-if ($erroralert eq "YES")
- {
- ## write errors to a separate file (just for errors---we append the errrors to end of file)
- ## the error file (rubikstateERRORS.dat) was created by the TeX file
- my $ne; #number of errors
- $ne=$#error; ## number of errors= largest index num since we started at zero
- ### do not attach error to a <checkstate> command
- if ($rotationcommand eq "checkstate") {}
- else {
- print (TeX_OUT_FILE "\\typeout{** ERROR: command=$rotationcommand}\%\n");
- print (ERROR_OUT_FILE "** ERROR: $rotationcommand\n");
- };
- ## last index number or array = $#arrayname (Black book p 62)
- my $k;
- for ($k=0; $k<=$ne; $k=$k+1) {
- print (TeX_OUT_FILE "\\typeout{$error[$k]}\%\n");
- print (ERROR_OUT_FILE "$error[$k]\n");
- };
- };
-print " Perl output file written OK\n";
-}
-##===========================================
-\end{verbatim}
-
-%-----------------
-\subsection{rrR}
-
-
-\begin{verbatim}
-## The following 9 (90 degree) rotation transformations are used
-## to generate all the rotations used in the `rotation sub'
-## each of these is a permutation for both colours and numbers
-## of the cubie facelets.
-## The following 9 subroutines are named as follows:
-## (about X-axis) rrR, rrSr, rrLp
-## (about Y-axis) rrU, rrSu, rrDp
-## (about Z-axis) rrF, rrSf, rrBp
-## see the rubikcube package documentation for full details regarding
-## rotation notation and commands.
-## METHOD & NOTATION
-## each sub (below) starts by making an array[0] for the cubie colour
-## and an array[1] for the cubie number.
-## Each of the face rotations (rrR, rrLp, rrU, rrDp, rrF, rrBp) is involved with
-## two pairs of connected but different permutations/transformations as follows:
-## (a) one pair for the 12 Side cubies (arrays = @Xs0 (for Side colours), @Xs1 (for Side numbers)), and
-## (b) one pair for the 9 Face cubies (arrays = @Xf0 (for Face colours), @Xf1 (for Face numbers)).
-## Each of the center slice rotations (rrSr, rrSu, rrSf) is involved with just one pair of
-## permutations for the 12 Side cubies (arrays = @Xs0 (for Side colours), @Xs1 (for Side numbers)).
-## We document only the side and face of the first sub (rrR) in detail, since the other subs are of similar form.
-##================================================
- sub rrR{
-
-## the R (slice + face) transform
-## R = RIGHT, s = side; 0=colour, 1= number
-## make the clockwise rotation permutation
-## In this permutation the Front-right-bottom (Frb) (side)facelet rotates to
-## the new position of Up-right-bottom (Urb) (side)facelet.
-##-----------SIDE-------
-## 12 side cubie facelets in arrays @Rs0 (colours) and @Rs1 (numbers)
-## these are the initial positions
-@Rs0=($Frb[0],$Frm[0],$Frt[0],
- $Urb[0],$Urm[0],$Urt[0],
- $Blt[0],$Blm[0],$Blb[0],
- $Drb[0],$Drm[0],$Drt[0]);
-
-@Rs1=($Frb[1],$Frm[1],$Frt[1],
- $Urb[1],$Urm[1],$Urt[1],
- $Blt[1],$Blm[1],$Blb[1],
- $Drb[1],$Drm[1],$Drt[1]);
-
-## now we reallocate the initial array elements to the new
-## post (90 degree clockwise) rotation position.
-## Cube is viewed from FRONT.
-## Positions of side facelets of Right slice are numbered 0-11 in clockwise direction,
-## (as seen from Right face) starting with Up-right-bottom facelet.
-## First line example:
-## variable $Urb[0] (Upface-right-bottom colour) <-- colour of first element in @Rs0 (=Frb[0])
-## variable $Urb[1] (Upface-right-bottom number) <-- number of first element in @Rs1 (=Frb[1])
-$Urb[0]=$Rs0[0]; $Urb[1]=$Rs1[0];
-$Urm[0]=$Rs0[1]; $Urm[1]=$Rs1[1];
-$Urt[0]=$Rs0[2]; $Urt[1]=$Rs1[2];
-
-$Blt[0]=$Rs0[3]; $Blt[1]=$Rs1[3];
-$Blm[0]=$Rs0[4]; $Blm[1]=$Rs1[4];
-$Blb[0]=$Rs0[5]; $Blb[1]=$Rs1[5];
-
-$Drb[0]=$Rs0[6]; $Drb[1]=$Rs1[6];
-$Drm[0]=$Rs0[7]; $Drm[1]=$Rs1[7];
-$Drt[0]=$Rs0[8]; $Drt[1]=$Rs1[8];
-
-$Frb[0]=$Rs0[9]; $Frb[1]=$Rs1[9];
-$Frm[0]=$Rs0[10]; $Frm[1]=$Rs1[10];
-$Frt[0]=$Rs0[11]; $Frt[1]=$Rs1[11];
-
-##-------------Right FACE---------------------
-## R FACE (9 cubies in each array)
-## (numbered in rows: 1,2,3/4,5,6/7,8,9 from top left(1) to bottom right(9))
-## R=Right, f = face; 0=colour, 1= number
-## do the Rface (90 degree) rotation transform
-## here the Right-left-bottom (Rlb) facelet rotates to the possn of Right-left-top (Rlt)
-## we start with two arrays (one for colours @Rf0, one for numbers @Rf1) with 9 elements each.
-@Rf0=($Rlb[0], $Rlm[0], $Rlt[0], $Rmb[0], $Rmm[0], $Rmt[0], $Rrb[0], $Rrm[0], $Rrt[0]);
-@Rf1=($Rlb[1], $Rlm[1], $Rlt[1], $Rmb[1], $Rmm[1], $Rmt[1], $Rrb[1], $Rrm[1], $Rrt[1]);
-
-## now we reallocate the array elements to the new
-## post (90 degree clockwise) rotation facelet position.
-## Right face is viewed from RIGHT.
-## First line example:
-## variable $Rlt[0] (=Right-left-top colour) <-- colour of first element in @Rf0 (=Rlb[0])
-## variable $Rlt[1] (=Right-left-top number) <-- number of first element in @Rf1 (=Rlb[1])
-$Rlt[0]=$Rf0[0]; $Rlt[1]=$Rf1[0];
-$Rmt[0]=$Rf0[1]; $Rmt[1]=$Rf1[1];
-$Rrt[0]=$Rf0[2]; $Rrt[1]=$Rf1[2];
-
-$Rlm[0]=$Rf0[3]; $Rlm[1]=$Rf1[3];
-$Rmm[0]=$Rf0[4]; $Rmm[1]=$Rf1[4];
-$Rrm[0]=$Rf0[5]; $Rrm[1]=$Rf1[5];
-
-$Rlb[0]=$Rf0[6]; $Rlb[1]=$Rf1[6];
-$Rmb[0]=$Rf0[7]; $Rmb[1]=$Rf1[7];
-$Rrb[0]=$Rf0[8]; $Rrb[1]=$Rf1[8];
-
-}
-#============================
-\end{verbatim}
-
-
-%--------------------
-\subsection{rrSr}
-
-
-\begin{verbatim}
-sub rrSr {
-## Sr = Right middle SLICE rotation (only 12 side facelets)
-## modified from rrR (change the U,D,F, r --> m and Back Bl-->Bm; Rs--> ?Srs)
-## change only the slice
-## s = side; 0=colour, 1= number
-## make the post rotation permutation
-
-@SRs0=($Fmb[0],$Fmm[0],$Fmt[0],
- $Umb[0],$Umm[0],$Umt[0],
- $Bmt[0],$Bmm[0],$Bmb[0],
- $Dmb[0],$Dmm[0],$Dmt[0]);
-
-@SRs1=($Fmb[1],$Fmm[1],$Fmt[1],
- $Umb[1],$Umm[1],$Umt[1],
- $Bmt[1],$Bmm[1],$Bmb[1],
- $Dmb[1],$Dmm[1],$Dmt[1]);
-
-
-$Umb[0]=$SRs0[0]; $Umb[1]=$SRs1[0];
-$Umm[0]=$SRs0[1]; $Umm[1]=$SRs1[1];
-$Umt[0]=$SRs0[2]; $Umt[1]=$SRs1[2];
-
-$Bmt[0]=$SRs0[3]; $Bmt[1]=$SRs1[3];
-$Bmm[0]=$SRs0[4]; $Bmm[1]=$SRs1[4];
-$Bmb[0]=$SRs0[5]; $Bmb[1]=$SRs1[5];
-
-$Dmb[0]=$SRs0[6]; $Dmb[1]=$SRs1[6];
-$Dmm[0]=$SRs0[7]; $Dmm[1]=$SRs1[7];
-$Dmt[0]=$SRs0[8]; $Dmt[1]=$SRs1[8];
-
-$Fmb[0]=$SRs0[9]; $Fmb[1]=$SRs1[9];
-$Fmm[0]=$SRs0[10]; $Fmm[1]=$SRs1[10];
-$Fmt[0]=$SRs0[11]; $Fmt[1]=$SRs1[11];
-
-}
-##===================
-\end{verbatim}
-
-
-%--------------------
-\subsection{rrLp}
-
-
-\begin{verbatim}
-sub rrLp{
-
-## Left slice (side + face) anticlockwise rotation
-## s = side; 0=colour, 1= number
-##-------------side-----------
-@LPs0=($Flb[0],$Flm[0],$Flt[0],
- $Ulb[0],$Ulm[0],$Ult[0],
- $Brt[0],$Brm[0],$Brb[0],
- $Dlb[0],$Dlm[0],$Dlt[0]);
-
-@LPs1=($Flb[1],$Flm[1],$Flt[1],
- $Ulb[1],$Ulm[1],$Ult[1],
- $Brt[1],$Brm[1],$Brb[1],
- $Dlb[1],$Dlm[1],$Dlt[1]);
-
-
-$Ulb[0]=$LPs0[0]; $Ulb[1]=$LPs1[0];
-$Ulm[0]=$LPs0[1]; $Ulm[1]=$LPs1[1];
-$Ult[0]=$LPs0[2]; $Ult[1]=$LPs1[2];
-
-$Brt[0]=$LPs0[3]; $Brt[1]=$LPs1[3];
-$Brm[0]=$LPs0[4]; $Brm[1]=$LPs1[4];
-$Brb[0]=$LPs0[5]; $Brb[1]=$LPs1[5];
-
-$Dlb[0]=$LPs0[6]; $Dlb[1]=$LPs1[6];
-$Dlm[0]=$LPs0[7]; $Dlm[1]=$LPs1[7];
-$Dlt[0]=$LPs0[8]; $Dlt[1]=$LPs1[8];
-
-$Flb[0]=$LPs0[9]; $Flb[1]=$LPs1[9];
-$Flm[0]=$LPs0[10]; $Flm[1]=$LPs1[10];
-$Flt[0]=$LPs0[11]; $Flt[1]=$LPs1[11];
-
-
-##---------------Left FACE-------------
-## do the Lface transform (in rows: 1,2,3//4,5,6//7,8,9)
-## f = face; 0=colour, 1= number
-## NOTES: not same as for R
-
-@LPf0=($Lrt[0], $Lrm[0], $Lrb[0], $Lmt[0], $Lmm[0], $Lmb[0], $Llt[0], $Llm[0], $Llb[0]);
-@LPf1=($Lrt[1], $Lrm[1], $Lrb[1], $Lmt[1], $Lmm[1], $Lmb[1], $Llt[1], $Llm[1], $Llb[1]);
-
-$Llt[0]=$LPf0[0]; $Llt[1]=$LPf1[0];
-$Lmt[0]=$LPf0[1]; $Lmt[1]=$LPf1[1];
-$Lrt[0]=$LPf0[2]; $Lrt[1]=$LPf1[2];
-
-$Llm[0]=$LPf0[3]; $Llm[1]=$LPf1[3];
-$Lmm[0]=$LPf0[4]; $Lmm[1]=$LPf1[4];
-$Lrm[0]=$LPf0[5]; $Lrm[1]=$LPf1[5];
-
-$Llb[0]=$LPf0[6]; $Llb[1]=$LPf1[6];
-$Lmb[0]=$LPf0[7]; $Lmb[1]=$LPf1[7];
-$Lrb[0]=$LPf0[8]; $Lrb[1]=$LPf1[8];
-}
-##==================================
-\end{verbatim}
-
-
-%------------------
-\subsection{rrU}
-
-
-\begin{verbatim}
-sub rrU{
-
-## Up slice (side + face)
-## do the Uside transform
-## s = side; 0=colour, 1= number
-## ----------SIDE--------------
-@Us0=($Lrt[0],$Lmt[0],$Llt[0],
- $Brt[0],$Bmt[0],$Blt[0],
- $Rrt[0],$Rmt[0],$Rlt[0],
- $Frt[0],$Fmt[0],$Flt[0]);
-
-@Us1=($Lrt[1],$Lmt[1],$Llt[1],
- $Brt[1],$Bmt[1],$Blt[1],
- $Rrt[1],$Rmt[1],$Rlt[1],
- $Frt[1],$Fmt[1],$Flt[1]);
-
-
-$Brt[0]=$Us0[0]; $Brt[1]=$Us1[0];
-$Bmt[0]=$Us0[1]; $Bmt[1]=$Us1[1];
-$Blt[0]=$Us0[2]; $Blt[1]=$Us1[2];
-
-$Rrt[0]=$Us0[3]; $Rrt[1]=$Us1[3];
-$Rmt[0]=$Us0[4]; $Rmt[1]=$Us1[4];
-$Rlt[0]=$Us0[5]; $Rlt[1]=$Us1[5];
-
-$Frt[0]=$Us0[6]; $Frt[1]=$Us1[6];
-$Fmt[0]=$Us0[7]; $Fmt[1]=$Us1[7];
-$Flt[0]=$Us0[8]; $Flt[1]=$Us1[8];
-
-$Lrt[0]=$Us0[9]; $Lrt[1]=$Us1[9];
-$Lmt[0]=$Us0[10]; $Lmt[1]=$Us1[10];
-$Llt[0]=$Us0[11]; $Llt[1]=$Us1[11];
-
-##-------------Up FACE-------------------
-## do the Rface transform (in rows: 1,2,3//4,5,6//7,8,9)
-## f = face; 0=colour, 1= number
-@Uf0=($Ulb[0], $Ulm[0], $Ult[0], $Umb[0], $Umm[0], $Umt[0], $Urb[0], $Urm[0], $Urt[0]);
-@Uf1=($Ulb[1], $Ulm[1], $Ult[1], $Umb[1], $Umm[1], $Umt[1], $Urb[1], $Urm[1], $Urt[1]);
-
-$Ult[0]=$Uf0[0]; $Ult[1]=$Uf1[0];
-$Umt[0]=$Uf0[1]; $Umt[1]=$Uf1[1];
-$Urt[0]=$Uf0[2]; $Urt[1]=$Uf1[2];
-
-$Ulm[0]=$Uf0[3]; $Ulm[1]=$Uf1[3];
-$Umm[0]=$Uf0[4]; $Umm[1]=$Uf1[4];
-$Urm[0]=$Uf0[5]; $Urm[1]=$Uf1[5];
-
-$Ulb[0]=$Uf0[6]; $Ulb[1]=$Uf1[6];
-$Umb[0]=$Uf0[7]; $Umb[1]=$Uf1[7];
-$Urb[0]=$Uf0[8]; $Urb[1]=$Uf1[8];
-}
-##==============================
-\end{verbatim}
-
-
-%----------------------
-\subsection{rrSu}
-
-
-\begin{verbatim}
-sub rrSu{
-## middle slice rotation (side only 12 facelets)
-## s = side; 0=colour, 1= number
-## make the post rotation permutation
-##-----------SIDE-------------------
-@SUs0=($Lrm[0],$Lmm[0],$Llm[0],
- $Brm[0],$Bmm[0],$Blm[0],
- $Rrm[0],$Rmm[0],$Rlm[0],
- $Frm[0],$Fmm[0],$Flm[0]);
-
-@SUs1=($Lrm[1],$Lmm[1],$Llm[1],
- $Brm[1],$Bmm[1],$Blm[1],
- $Rrm[1],$Rmm[1],$Rlm[1],
- $Frm[1],$Fmm[1],$Flm[1]);
-
-
-$Brm[0]=$SUs0[0]; $Brm[1]=$SUs1[0];
-$Bmm[0]=$SUs0[1]; $Bmm[1]=$SUs1[1];
-$Blm[0]=$SUs0[2]; $Blm[1]=$SUs1[2];
-
-$Rrm[0]=$SUs0[3]; $Rrm[1]=$SUs1[3];
-$Rmm[0]=$SUs0[4]; $Rmm[1]=$SUs1[4];
-$Rlm[0]=$SUs0[5]; $Rlm[1]=$SUs1[5];
-
-$Frm[0]=$SUs0[6]; $Frm[1]=$SUs1[6];
-$Fmm[0]=$SUs0[7]; $Fmm[1]=$SUs1[7];
-$Flm[0]=$SUs0[8]; $Flm[1]=$SUs1[8];
-
-$Lrm[0]=$SUs0[9]; $Lrm[1]=$SUs1[9];
-$Lmm[0]=$SUs0[10]; $Lmm[1]=$SUs1[10];
-$Llm[0]=$SUs0[11]; $Llm[1]=$SUs1[11];
-}
-##==============================
-\end{verbatim}
-
-
-%--------------------
-\subsection{rrDp}
-
-
-
-\begin{verbatim}
-sub rrDp{
-
-## Dpwn Face anticlockwise rotation (side and face)
-## s = side; 0=colour, 1= number
-## make the post rotation permutation
-##--------------SIDE----------------
-@DPs0=($Lrb[0],$Lmb[0],$Llb[0],
- $Brb[0],$Bmb[0],$Blb[0],
- $Rrb[0],$Rmb[0],$Rlb[0],
- $Frb[0],$Fmb[0],$Flb[0]);
-
-@DPs1=($Lrb[1],$Lmb[1],$Llb[1],
- $Brb[1],$Bmb[1],$Blb[1],
- $Rrb[1],$Rmb[1],$Rlb[1],
- $Frb[1],$Fmb[1],$Flb[1]);
-
-$Brb[0]=$DPs0[0]; $Brb[1]=$DPs1[0];
-$Bmb[0]=$DPs0[1]; $Bmb[1]=$DPs1[1];
-$Blb[0]=$DPs0[2]; $Blb[1]=$DPs1[2];
-
-$Rrb[0]=$DPs0[3]; $Rrb[1]=$DPs1[3];
-$Rmb[0]=$DPs0[4]; $Rmb[1]=$DPs1[4];
-$Rlb[0]=$DPs0[5]; $Rlb[1]=$DPs1[5];
-
-$Frb[0]=$DPs0[6]; $Frb[1]=$DPs1[6];
-$Fmb[0]=$DPs0[7]; $Fmb[1]=$DPs1[7];
-$Flb[0]=$DPs0[8]; $Flb[1]=$DPs1[8];
-
-$Lrb[0]=$DPs0[9]; $Lrb[1]=$DPs1[9];
-$Lmb[0]=$DPs0[10]; $Lmb[1]=$DPs1[10];
-$Llb[0]=$DPs0[11]; $Llb[1]=$DPs1[11];
-
-##---------------Down FACE-------------------
-## f = face; 0=colour, 1= number
-
-@DPf0=($Dlt[0], $Dlm[0], $Dlb[0], $Dmt[0], $Dmm[0], $Dmb[0], $Drt[0], $Drm[0], $Drb[0]);
-@DPf1=($Dlt[1], $Dlm[1], $Dlb[1], $Dmt[1], $Dmm[1], $Dmb[1], $Drt[1], $Drm[1], $Drb[1]);
-
-$Dlb[0]=$DPf0[0]; $Dlb[1]=$DPf1[0];
-$Dmb[0]=$DPf0[1]; $Dmb[1]=$DPf1[1];
-$Drb[0]=$DPf0[2]; $Drb[1]=$DPf1[2];
-
-$Dlm[0]=$DPf0[3]; $Dlm[1]=$DPf1[3];
-$Dmm[0]=$DPf0[4]; $Dmm[1]=$DPf1[4];
-$Drm[0]=$DPf0[5]; $Drm[1]=$DPf1[5];
-
-$Dlt[0]=$DPf0[6]; $Dlt[1]=$DPf1[6];
-$Dmt[0]=$DPf0[7]; $Dmt[1]=$DPf1[7];
-$Drt[0]=$DPf0[8]; $Drt[1]=$DPf1[8];
-}
-##==============================
-\end{verbatim}
-
-
-%%------------------
-\subsection{rrF}
-
-
-\begin{verbatim}
-sub rrF{
-
-## do the Fside transform (side and face)
-## s = side; 0=colour, 1= number
-## -----------SIDE-----------------
-@Fs0=($Lrb[0],$Lrm[0],$Lrt[0],
- $Ulb[0],$Umb[0],$Urb[0],
- $Rlt[0],$Rlm[0],$Rlb[0],
- $Drt[0],$Dmt[0],$Dlt[0]);
-
-@Fs1=($Lrb[1],$Lrm[1],$Lrt[1],
- $Ulb[1],$Umb[1],$Urb[1],
- $Rlt[1],$Rlm[1],$Rlb[1],
- $Drt[1],$Dmt[1],$Dlt[1]);
-
-$Ulb[0]=$Fs0[0]; $Ulb[1]=$Fs1[0];
-$Umb[0]=$Fs0[1]; $Umb[1]=$Fs1[1];
-$Urb[0]=$Fs0[2]; $Urb[1]=$Fs1[2];
-
-$Rlt[0]=$Fs0[3]; $Rlt[1]=$Fs1[3];
-$Rlm[0]=$Fs0[4]; $Rlm[1]=$Fs1[4];
-$Rlb[0]=$Fs0[5]; $Rlb[1]=$Fs1[5];
-
-$Drt[0]=$Fs0[6]; $Drt[1]=$Fs1[6];
-$Dmt[0]=$Fs0[7]; $Dmt[1]=$Fs1[7];
-$Dlt[0]=$Fs0[8]; $Dlt[1]=$Fs1[8];
-
-$Lrb[0]=$Fs0[9]; $Lrb[1]=$Fs1[9];
-$Lrm[0]=$Fs0[10]; $Lrm[1]=$Fs1[10];
-$Lrt[0]=$Fs0[11]; $Lrt[1]=$Fs1[11];
-
-## -------Front FACE-------------------
-## f = face; 0=colour, 1= number
-
-@Lf0=($Flb[0], $Flm[0], $Flt[0], $Fmb[0], $Fmm[0], $Fmt[0], $Frb[0], $Frm[0], $Frt[0]);
-@Lf1=($Flb[1], $Flm[1], $Flt[1], $Fmb[1], $Fmm[1], $Fmt[1], $Frb[1], $Frm[1], $Frt[1]);
-
-$Flt[0]=$Lf0[0]; $Flt[1]=$Lf1[0];
-$Fmt[0]=$Lf0[1]; $Fmt[1]=$Lf1[1];
-$Frt[0]=$Lf0[2]; $Frt[1]=$Lf1[2];
-
-$Flm[0]=$Lf0[3]; $Flm[1]=$Lf1[3];
-$Fmm[0]=$Lf0[4]; $Fmm[1]=$Lf1[4];
-$Frm[0]=$Lf0[5]; $Frm[1]=$Lf1[5];
-
-$Flb[0]=$Lf0[6]; $Flb[1]=$Lf1[6];
-$Fmb[0]=$Lf0[7]; $Fmb[1]=$Lf1[7];
-$Frb[0]=$Lf0[8]; $Frb[1]=$Lf1[8];
-}
-##==============================
-\end{verbatim}
-
-
-%-------------------
-\subsection{rrSf}
-
-
-\begin{verbatim}
-sub rrSf{
-
-## do the Fs transform (side only)
-## s = side; 0=colour, 1= number
-##----------SIDE---------------
-@SFs0=($Lmb[0],$Lmm[0],$Lmt[0],
- $Ulm[0],$Umm[0],$Urm[0],
- $Rmt[0],$Rmm[0],$Rmb[0],
- $Drm[0],$Dmm[0],$Dlm[0]);
-
-@SFs1=($Lmb[1],$Lmm[1],$Lmt[1],
- $Ulm[1],$Umm[1],$Urm[1],
- $Rmt[1],$Rmm[1],$Rmb[1],
- $Drm[1],$Dmm[1],$Dlm[1]);
-
-$Ulm[0]=$SFs0[0]; $Ulm[1]=$SFs1[0];
-$Umm[0]=$SFs0[1]; $Umm[1]=$SFs1[1];
-$Urm[0]=$SFs0[2]; $Urm[1]=$SFs1[2];
-
-$Rmt[0]=$SFs0[3]; $Rmt[1]=$SFs1[3];
-$Rmm[0]=$SFs0[4]; $Rmm[1]=$SFs1[4];
-$Rmb[0]=$SFs0[5]; $Rmb[1]=$SFs1[5];
-
-$Drm[0]=$SFs0[6]; $Drm[1]=$SFs1[6];
-$Dmm[0]=$SFs0[7]; $Dmm[1]=$SFs1[7];
-$Dlm[0]=$SFs0[8]; $Dlm[1]=$SFs1[8];
-
-$Lmb[0]=$SFs0[9]; $Lmb[1]=$SFs1[9];
-$Lmm[0]=$SFs0[10]; $Lmm[1]=$SFs1[10];
-$Lmt[0]=$SFs0[11]; $Lmt[1]=$SFs1[11];
-}
-##==============================
-\end{verbatim}
-
-
-%-------------------
-\subsection{rrBp}
-
-
-\begin{verbatim}
-sub rrBp{
-
-## Back rotation anticlockwise (side + face)
-## do the Bp side transform
-## s = side; 0=colour, 1= number
-## --------------Side-----------------
-@BPs0=($Llb[0],$Llm[0],$Llt[0],
- $Ult[0],$Umt[0],$Urt[0],
- $Rrt[0],$Rrm[0],$Rrb[0],
- $Drb[0],$Dmb[0],$Dlb[0]);
-
-@BPs1=($Llb[1],$Llm[1],$Llt[1],
- $Ult[1],$Umt[1],$Urt[1],
- $Rrt[1],$Rrm[1],$Rrb[1],
- $Drb[1],$Dmb[1],$Dlb[1]);
-
-$Ult[0]=$BPs0[0]; $Ult[1]=$BPs1[0];
-$Umt[0]=$BPs0[1]; $Umt[1]=$BPs1[1];
-$Urt[0]=$BPs0[2]; $Urt[1]=$BPs1[2];
-
-$Rrt[0]=$BPs0[3]; $Rrt[1]=$BPs1[3];
-$Rrm[0]=$BPs0[4]; $Rrm[1]=$BPs1[4];
-$Rrb[0]=$BPs0[5]; $Rrb[1]=$BPs1[5];
-
-$Drb[0]=$BPs0[6]; $Drb[1]=$BPs1[6];
-$Dmb[0]=$BPs0[7]; $Dmb[1]=$BPs1[7];
-$Dlb[0]=$BPs0[8]; $Dlb[1]=$BPs1[8];
-
-$Llb[0]=$BPs0[9]; $Llb[1]=$BPs1[9];
-$Llm[0]=$BPs0[10]; $Llm[1]=$BPs1[10];
-$Llt[0]=$BPs0[11]; $Llt[1]=$BPs1[11];
-
-##-----------------Back FACE-------------
-## do the B face transform (in rows: 1,2,3/4,5,6/7,8,9)
-## f = face; 0=colour, 1= number
-@BPf0=($Brb[0], $Brm[0], $Brt[0], $Bmb[0], $Bmm[0], $Bmt[0], $Blb[0], $Blm[0], $Blt[0]);
-
-@BPf1=($Brb[1], $Brm[1], $Brt[1], $Bmb[1], $Bmm[1], $Bmt[1], $Blb[1], $Blm[1], $Blt[1]);
-
-$Brt[0]=$BPf0[0]; $Brt[1]=$BPf1[0];
-$Bmt[0]=$BPf0[1]; $Bmt[1]=$BPf1[1];
-$Blt[0]=$BPf0[2]; $Blt[1]=$BPf1[2];
-
-$Brm[0]=$BPf0[3]; $Brm[1]=$BPf1[3];
-$Bmm[0]=$BPf0[4]; $Bmm[1]=$BPf1[4];
-$Blm[0]=$BPf0[5]; $Blm[1]=$BPf1[5];
-
-$Brb[0]=$BPf0[6]; $Brb[1]=$BPf1[6];
-$Bmb[0]=$BPf0[7]; $Bmb[1]=$BPf1[7];
-$Blb[0]=$BPf0[8]; $Blb[1]=$BPf1[8];
-}
-##=====================end===================================
-\end{verbatim}
-
-\begin{center}
------- END ------
-\end{center}
-
-\end{landscape}
-
-\end{document}