3 <meta content=
"text/html; charset=UTF-8" http-equiv=
"content-type"/>
4 <style type=
"text/css">
23 .five sup { margin-left: -1em; }
24 .five object { margin-right: 1em; }
32 <script type=
"text/javascript">
38 , 'br': 'bottom-right'
44 , 'dr': 'bottom-right'
48 'rd': 'right-down-3x3'
49 , 'ru': 'right-up-3x3'
50 ,'ld': 'left-down-3x3'
52 , 'bl': 'bottom-left-3x3'
53 , 'br': 'bottom-right-3x3'
54 , 'cw': 'front-cw-3x3'
55 , 'cc': 'front-ccw-3x3'
56 , 'tl': 'top-left-3x3'
57 , 'tr': 'top-right-3x3'
58 , 'ml': 'middle-left-3x3'
59 , 'mr': 'middle-right-3x3'
62 var size
= 64, stepSize
= 24, mapping
= twoMapping
;
64 function Rule(name
, steps
)
68 this.stepSize
= stepSize
;
69 this.steps
= steps
.split(' ');
70 this.mapping
= mapping
;
73 Rule
.prototype.toString = function()
76 code
.push('<table class="desc"><tr>');
77 code
.push('<td class="rule"><object data="');
80 code
.push('.svg" type="image/svg+xml" width="');
81 code
.push(this.name
.match(/case-[ab]/) ? 290 : this.size
);
82 code
.push('" height="');
84 code
.push('"></object></td><td class="steps">');
87 var breakIssued
= false;
88 for (var i
in this.steps
)
90 if(this.steps
[i
] == '2')
93 code
.push('<sup>×2</sup>');
96 var step
= this.mapping
[this.steps
[i
]];
97 code
.push('<object data="');
100 code
.push('.svg" type="image/svg+xml" width="');
101 code
.push(this.stepSize
);
102 code
.push('" height="');
103 code
.push(this.stepSize
);
104 code
.push('"></object>');
105 if (i
>= this.steps
.length
/ 2 - 1 - missBreaks
&& !breakIssued
)
112 code
.push('</tr></table>');
114 return code
.join('');
118 new Rule('swap-adjacent', 'cw dr cc dl rd dl ru')
119 , new Rule('swap-diagonal', 'cc rd dl ru dr cw dl')
123 new Rule('case-a', 'rd cc ru cc rd cw cw ru cw cw')
124 , new Rule('case-b', 'cw cw rd cw cw ru cw rd cw ru')
129 mapping
= threeMapping
;
132 new Rule('top-center-middle-left', 'tr cc tl cw tl ru tr rd')
133 , new Rule('swap-edges', 'tl cw ru tl rd tr cc')
134 , new Rule('shift-corners-cw', 'tr rd bl ru tl rd br ru')
135 , new Rule('shift-corners-ccw', 'rd bl ru tr rd br ru tl')
137 , new Rule('top-center-middle-right', 'tl ru tr rd tr cc tl cw')
138 , new Rule('mirror-edge', 'ru mr ru mr ru mr ru mr')
139 , new Rule('rotate-corner-cw', 'ru bl rd br ru bl rd br')
140 , new Rule('rotate-corner-ccw', 'bl ru br rd bl ru br rd')
144 'tl': 'top-left-5x5',
145 'cc': 'front-ccw-5x5',
146 'ld': 'left-down-5x5',
147 'tr': 'top-right-5x5',
148 'dl': 'bottom-left-5x5',
149 'dr': 'bottom-right-5x5'
153 new Rule('swap-edges-5x5', 'tr cc 2 tr cc 2 ld 2 tr ld 2 dr cc 2 dl cc 2 tl 2')
158 document
.write('<div class="ruleset">' + twoRules
.join('') + '</div>');
159 document
.write('<hr/>');
160 document
.write('<div class="ruleset1">' + twoCases
.join('') + '</div>');
161 document
.write('<hr/>');
162 document
.write('<div class="ruleset">' + threeRules
.join('') + '</div>');
163 document
.write('<hr/>');
164 document
.write('<div class="ruleset five">' + fiveRules
.join('') + '</div>');