www.randelshofer.ch

RubikPlayer 4.1.1

 

© Werner Randelshofer

Readme  Changes  License

 

Read me

Contents

Purpose
License Fee
Known Issues
System Requirements
Applet Tag

Supported Script Notations

Examples
Tests
Copyright


^ Purpose

The purpose of the RubikPlayer applet is to display an interactive model of Rubik's Cube on a web page.

Features

  • Accurate 3D model of Rubik's Cube

    The color scheme of the model can be adapted to represent a particular cube or a specific state of a cube.

  • A QuickTime style player.

    Plays back cube scripts written in BandelowENG or RandelshoferGER notation.

  • Flexibility

    17 parameters provide control over the appearance and the behaviour of the cube.


^ License Fee

RubikPlayer is free of a charge for non-commercial use. If you have a feature request or if you are mind-bogglingly happy with it, send me a bottle of good wine.

Redistribution or commercial use is subject to additional license fees. Please contact me.


^ Known Issues

  • Only 5 applets per page can play back a script simultaneously.

^ System Requirements

  • A browser supporting JDK 1.1 or better.

^ Applet Tag

The file rubikplayer.zip contains the applet.

To incorporate it into a html document, you have to put it into the same directory as your HTML document. The document must provide the following applet tag:

<applet
    code="ch.randelshofer.rubik.RubikPlayerApp.class"
    archive="rubikplayer.zip"
    width="264" height="245">

<param name="scriptLanguage" value="BandelowENG">
<param name="scriptType" value="Generator">
<param name="script" value="MR2 MF2 MD2">
<param name="scriptProgress" value="-1">

<param name="initScript" value="R2 D2">

<param name="displayLines" value="1">

<param name="alpha" value="-25">
<param name="beta"  value="45">

<param name="colorTable" value="0x003373,0xff4600,0xf8f8f8,0x00732f,red=0x8c000f,0xffd200">

<param name="faces" value="0,1,2,3,red,5">

<param name="stickers" value="0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3, red,red,red,red,red,red,red,red,red, 5,5,5,5,5,5,5,5,5">

<param name="backgroundColor" value="0xffffff">
<param name="backgroundImage" value="water.jpg">

<param name="ambientLightIntensity" value="1.0">
<param name="lightSourceIntensity" value="0.6">
<param name="lightSourcePosition" value="-500,500,1000">

</applet>

Parameter-NameType Description
   
codestringThe name of the applet class.
This parameter must have the value "ch.randelshofer.rubik.RubikPlayerApp.class".
archivestring

The name of the file that holds the applet class.
This parameter must have the value "rubikplayer.zip"

widthint

The width of the applet.
Range: 1..9999

heightint

The height of the applet
Range: 1..9999

   
scriptLanguagestring

The language (notation) of the script. (see here for more details):
Choice of : "BandelowENG", "HarrisENG", "RandelshoferGER", "ScriptFRA", "SupersetENG", "TouchardDeledicq"
Default value: "BandelowENG"

scriptType string

The type of the script.
A "Generator" transforms the cube from a source state to a target state. The source state of a generator is the initial state of the cube.
A "Solver" also transforms the cube from a source state to a target state. The source state is the initial state of the cube transformed by the inverse of the script.
Choice of: "Generator", "Solver"
Default value: "Generator"

Tip: Use generators to describe pretty patterns, use solvers to describe maneuvers.

scriptstring

The script.
Default value: no script

scriptProgressint

Position of the progress bar. Positive values are offsets from the start of the script, negative values are offsets from the end of the script.
Range: -9999..9999

Default value: -1

     
initScript string

An initScript is used to set up the initial position of the cube.
If you don't specify an initScript, the solved state of the cube is used.

Default value: no script

   
displayLinesint

Number of lines of the script to display.
Set to 0 to switch the display off.
Default value: 1

   
alphaintAlpha view angle of the cube.
Range: -90..90
Default value: 45
betaint

Beta view angle of the cube.
Range: -90..90
Default value: -25

   
colorTableint, int, ...

RGB color look up table. The colors in this table can be referenced by the faces and the stickers attribute. The table may contain up to 54 different values.
The default values represent the colors of the Arxon cube: blue, orange, white, green, red and yellow.
This results into the following color scheme:

  5   
  0  1  3 
  2   

Range: 0x000000..0xffffff
Default value: 0x003373,0xff4600,0xf8f8f8,0x00732f,0x8c000f,0xffd200

Tip: For ease of use, you can assign names to the colors.
Instead of writing 0x003373 you can write blue=0x003373 or b=0x003373.

facesint, int, ...

Maps colors from the color table to the faces of the cube.
6 integer values: front, right, down, back, left, up.
The values of the faces parameter are overriden by the stickers parameter if present.
Range: 0..54
Default value: 0,1,2,3,4,5

The face values are organized like this:

  5   
 4  0  1  3 
  2   

Tip: You can reference a color defined in "colorsTable" by its index or by its name.

stickersints

Maps colors from the color table to the stickers of the cube;
54 integer values: front, right, down, back, left, up.
The stickers parameter overrides the values of the faces parameter.
Range: 0..54
Default value: 0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4, 5,5,5,5,5,5,5,5,5

The sticker values are organized like this:

   454647      
   484950      
   515253      
36373801291011272829
394041345121314303132
424344 6 78151617333435 
   181920      
   212223      
   242526      

Tip: You can reference a color defined in "colorsTable" by its index or by its name.

backgroundColorint

Specifies the background color of the applet.
Range: 0x000000..0xffffff
Default value: 0xffffff

backgroundImageURL

Specifies the url of the background image.
Default value: no background image

ambientLightIntensityfloat

Specifies the intensity of the ambient light.
Range: 0.0..1.0
Default value: 0.6

lightSourceIntensityfloat

Specifies the intensity of the light source.
Range: 0.0..1.0
Default value: 1.0

lightSourceLocationint,int,int

Specifies the location of the light source using a right-handed X, Y, Z coordinate system. +X is horizontal to the right, +Y is the local gravitational up, +Z is directly toward the viewer..
Values: X, Y, Z
Default value: -500, 500, 1000

 


^ Supported Script Notations

The RubikPlayer applet supports the following script notations:

BandelowENG
HarrisENG
RandelshoferGER
ScriptFRA
SupersetENG
TouchardDeledicqFRA

 

BandelowENG

This is an English version of Bandelow's notation published in the following book:
Bandelow, Christoph. (1981). Einführung in die Cubologie. Vieweg.

Surface layer twists:RightUpFrontLeftDownBack
90° clockwise
90° anti-clockwise R'U'F'L'D'B'
180° clockwiseR2U2F2L2D2B2
180° anti-clockwise  R2' U2' F2' L2' D2' B2'
       
Mid-layer twists:RightUpFrontLeftDownBack
90° clockwiseMR MU MF ML MD MB 
90° anti-clockwise MR'MU'MF'ML'MD'MB'
180° clockwiseMR2MU2MF2ML2MD2MB2
       
Cube rotations:RightUpFrontLeftDownBack
90° clockwiseCR CU CF CL CD CB 
90° anti-clockwise CR'CU'CF'CL'CD'CB'
180° clockwiseCR2CU2CF2CL2CD2CB2
       
Cube rotations: 

Over two axis:

CFUCUBCRUCULCRFCLF
Over t hree axis: CUFLCURFCRUBCBUL  
 CLFOCFRUCBURCLUB  
       
Permutation:RightUpFrontLeftDownBack
Facesrufldb
Signs+-++   
       
Expressions: 
repeat x n-times  ( x ) n
invert x ( x ) '
invert x n-times  ( x ) n '
permutate parts ( [sign] part, part, part, ...)

HarrisENG

This notation by Dan Harris uses single letter tokens for all moves.

Surface layer twists: Right Up Front Left Down Back
90° clockwise
90° anti-clockwise  R' U' F' L' D' B'
180° clockwise R2 U2 F2 L2 D2 B2
180° anti-clockwise  R2' U2' F2' L2' D2' B2'
             
Two-layer twists: Right Up Front Left Down Back
90° clockwise r u f l d b
90° anti-clockwise  r' u' f' l' d' b'
180° clockwise r2 u2 f2 l2 d2 b2
180° anti-clockwise  r2' u2' f2' l2' d2' b2'
             
Mid-layer twists: Right Up Front Left Down Back
90° M' E' M E  S'
180° M2' E2' S2 M2 E2 S2'
             
Slice twists: Right Up Front Left Down Back
90° m' e' s m e s'
180° m2' e2' s2 m2 e2 s2'
             
Cube rotations: Right Up Front Left Down Back
90° z x' y' z'
180° x2 y2 z2 x2' y2' z2's
             
Expressions:  
sequence x y { x y }
repeat x n-times ( x ) * n
invert x ( x ) '
invert x n-times  ( x ) * n '
comments [ bla bla ]

 

RandelshoferGER

This notation by Walter Randelshofer is based on the german version of Bandelow's notation. It does not support multi-angle cube rotations, and it uses hyphens instead of apostrophes to improve the readability of scripts.

Surface layer twists:RightUpFrontLeftDownBack
90° clockwise
90° anti-clockwise R-O-V-L-U-H-
180° clockwiseR2O2V2L2U2H2
       
Mid-layer twists:RightUpFrontLeftDownBack
90° clockwiseMR MO MV ML MU MH 
90° anti-clockwise MR-MO-MV-ML-MU-MH-
180° clockwiseMR2MO2MV2ML2MU2MH2
       
Cube rotations:RightUpFrontLeftDownBack
90° clockwiseBR BO BV BL BU BH 
90° anti-clockwise BR-BO-BV-BL-BU-BH-
180° clockwiseBR2BO2BV2BL2BU2BH2
       
Permutation:RightUpFrontLeftDownBack
Facesrovluh
Signs+-++   
       
Expressions: 
repeat x n-times  ( x ) n
invert x ( x ) -
invert x n-times  ( x ) -n
permutate parts ( [sign] part, part, part, ...)

 

ScriptFRA

This is a French notation by Vincent Varoquaux.

Surface layer twists: Right Up Front Left Down Back
90° clockwise Dh Hg Fm Gb Bd Am
90° anti-clockwise  Db Hd F Gh Bg A
180° clockwise DD HH FF GG BB AA
             
Mid-layer twists: Right Up Front Left Down Back
90° clockwise Mh MCg MFg Mb MCd MFd
180° clockwise MM MCC MFF      
             
Cube rotations: Right Up Front Left Down Back
90° clockwise Ch Cg CRd Cb Cd CRg
180° clockwise CC CGG CRR      
             
Permutation: Right Up Front Left Down Back
Faces d h f g b a
Signs + - ++      
             
Expressions:  
repeat x n-times  ( x ) n
invert x ( x ) '
invert x n-times  ( x ) n'
permutate parts ( [sign] part, part, part, ...)

 

SupersetENG

This is a superset of Bandelow's notation. The superset adds two-layer twists and slice twists to the notation.

Surface layer twists: Right Up Front Left Down Back
90° clockwise
90° anti-clockwise  R' U' F' L' D' B'
180° clockwise R2 U2 F2 L2 D2 B2
180° anti-clockwise  R2' U2' F2' L2' D2' B2'
             
Two-layer twists: Right Up Front Left Down Back
90° clockwise TR TU TF TL TD TB
90° anti-clockwise  TR' TU' TF' TL' TD' TB'
180° clockwise TR2 TU2 TF2 TL2 TD2 TB2
180° anti-clockwise  TR2' TU2' TF2' TL2' TD2' TB2'
             
Mid-layer twists: Right Up Front Left Down Back
90° clockwise MR  MU  MF  ML  MD  MB 
90° anti-clockwise  MR' MU' MF' ML' MD' MB'
180° clockwise MR2 MU2 MF2 ML2 MD2 MB2
             
Slice twists: Right Up Front Left Down Back
90° clockwise SR  SU  SF  SL  SD  SB 
90° anti-clockwise  SR' SU' SF' SL' SD' SB'
180° clockwise SR2 SU2 SF2 SL2 SD2 SB2
             
Cube rotations: Right Up Front Left Down Back
90° clockwise CR  CU  CF  CL  CD  CB 
90° anti-clockwise  CR' CU' CF' CL' CD' CB'
180° clockwise CR2 CU2 CF2 CL2 CD2 CB2
             
Cube rotations:

Over two axis:

CFU CUB CRU CUL CRF CLF
Over t hree axis: CUFL CURF CRUB CBUL    
  CLFO CFRU CBUR CLUB    
             
Permutation: Right Up Front Left Down Back
Faces r u f l d b
Signs + - ++      
             
Expressions:  
repeat x n-times  ( x ) n
invert x ( x ) '
invert x n-times  ( x ) n '
permutate parts ( [sign] part, part, part, ...)

 

TouchardDeledicqFRA

This is a French notation by Jean-Baptiste Touchard and André Deledicq.

Surface layer twists: Right Up Front Left Down Back
90° clockwise
90° anti-clockwise  D- H- A- G- B- P-
180° D2 H2 A2 G2 B2 P2
             
Slice twists: Right Up Front Left Down Back
90° Ds  Hs  As  Gs  Bs  Ps 
180° D2s H2s A2s G2s B2s P2s
             
Expressions:  
repeat x n-times  ( x ) n
invert x ( x ) -
invert x n-times  ( x ) -n

 


^ Examples

Example 1No parameters are set.
Example 2All parameters are explicitly set to their default values.
Example 3Demonstrates the backgroundColor parameter.
Example 4Demonstrates the alpha and beta parameters.
Example 5Demonstrates the colorTable parameter.
Example 6Demonstrates the colorTable and faces parameters.
Example 7Demonstrates the stickers parameter.
Example 8Demonstrates the scriptLanguage, script and displayLines parameters.
Example 9This example uses all parameters together to show a maneuver, which moves an edge into its right position.
Example 10Demonstrates the lightSourcePosition parameter.
Example 11Demonstrates the ambientLightIntensity and lightSourceIntensity parameters.
Example 12Demonstrates the backgroundImage parameter.
Example 13 Demonstrates the use of disjoint cycle permutations using the Bandelow ENG notation.
Example 14 Demonstrates the use of Slice-Twists using the Superset ENG notation.
Example 15 Demonstrates the use of Two-Layer Twists using the Superset ENG notation.
Example 16 Demonstrates the difference between a Generator and a Solver script. (Use of the scriptType parameter).
Example 17 Demonstrates the use of the initScript parameter.
Example 18 Demonstrates the use of named colorTable values.

^ Tests

Test 1 Stress test. Features a large number of applets on a single page.

 


^ Copyright

RubikPlayer © 2000-2003
Werner Randelshofer, Staldenmattweg 2, Immensee, CH-6405, Switzerland
http://www.randelshofer.ch/
werner.randelshofer@bluewin.ch
All Rights Reserved.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. or other countries, and are used under license.

RubikPlayer is not derived from, is not associated with and is not endorsed or sponsered by the owner of the RUBIK'S CUBE Trademark. This owner is Seven Towns Limited, the manufacturer and worldwide distributor of the RUBIK'S CUBE three dimensional puzzle and provider of an electronic version of the puzzle via its official web site.