-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
494 lines (445 loc) · 14.2 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Deadalnix's algorithm set</title>
<style type="text/css">
.algcase {
float: left;
display: table;
width: 400px;
height: 150px;
}
.algcase p {
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
}
.algcase img {
float: left;
}
span.mainalg {
font-weight: bold;
font-size: 1.3em;
}
h2, h3 {
clear: left;
}
</style>
</head>
<body>
<h1>Deadalnix's algorithm set</h1>
<p>This is a list of all the algorithm I use. I plan to update it as I learn new ones.</p>
<?php
class URL {
private $base = '';
private $params = array();
public function __construct($base, $params = array()) {
// FIXME: Base should have some sanity checks in place, maybe.
$this->base = $base;
$this->params = $params;
}
public function __toString() {
$url = $this->base;
if (!$this->params) {
return $url;
}
return $url.'?'.http_build_query($this->params);
}
}
class HtmlElement {
const TAG = 'html';
private $params = array();
private $inner = array();
public function __construct($params = array(), $inners = array()) {
// FIXME: validate tag name.
$this->params = $params;
$this->inners = $inners;
}
public function __toString() {
$str = '<'.static::TAG;
foreach ($this->params as $name => $value) {
$str .= ' '.htmlentities($name).'="'.htmlentities($value).'"';
}
if (!$this->inners) {
return $str.' />';
}
$str .= '>';
foreach ($this->inners as $inner) {
if (!$inner instanceof HtmlElement) {
$inner = htmlentities($inner);
}
$str .= $inner;
}
return $str.'</'.static::TAG.'>';
}
}
class Img extends HtmlElement {
const TAG = 'img';
public function __construct(Url $src) {
parent::__construct(array('src' => $src));
}
}
class Div extends HtmlElement {
const TAG = 'div';
}
class P extends HtmlElement {
const TAG = 'p';
}
class Span extends HtmlElement {
const TAG = 'span';
}
class Br extends HtmlElement {
const TAG = 'br';
}
class AlgCase {
const STAGE = 'll';
const VIEW = '';
const CARDINALITY = 0;
private $name = '';
private $alg = '';
private $note = '';
private $alts = array();
const VISUALCUBE_URL = '/visualcube/visualcube.php';
public function __construct($name, $alg, $proba = 0, $note = '', $alts = array()) {
$this->name = $name;
$this->alg = $alg;
$this->proba = $proba;
$this->note = $note;
$this->alts = $alts;
}
public function __toString() {
$img = new Img(new Url(
self::VISUALCUBE_URL,
array(
'fmt' => 'svg',
'size' => 150,
'case' => $this->alg,
'stage' => static::STAGE,
'view' => static::VIEW,
)
));
$content = array();
$content[] = new Span(
array('class' => 'algorithm mainalg'),
array($this->alg)
);
if ($this->note) {
$content[] = new Br();
$content[] = $this->note;
}
$content[] = new Br();
foreach ($this->alts as $alt) {
$content[] = new Br();
$content[] = $alt;
}
$content[] = new Br();
$content[] = $this->name;
if (static::CARDINALITY != 0 && $this->proba != 0) {
if ($this->name) {
$content[] = ' - ';
}
$content[] = 'probability: 1/'.(static::CARDINALITY / $this->proba);
}
$div = new Div(
array('class' => 'algcase'),
array(
$img,
new P(array(), $content),
)
);
return (string)$div;
}
}
class F2l extends AlgCase {
const STAGE = 'f2l';
public function __construct($alg, $alts = array()) {
parent::__construct('', $alg, 0, '', $alts);
}
}
class Oll extends AlgCase {
const STAGE = 'oll';
const VIEW = 'plan';
const CARDINALITY = 216;
}
class Pll extends AlgCase {
const STAGE = 'll';
const VIEW = 'plan';
const CARDINALITY = 72;
}
class F2lFr extends F2l {
const STAGE = "f2l_1";
}
class F2lFl extends F2l {
const STAGE = "f2l_1-y";
}
class F2lBr extends F2l {
const STAGE = "f2l_1-y'";
}
function render_set($sets) {
foreach ($sets as $name => $set) {
echo '<h3>'.$name.'</h3>';
foreach ($set as $case) {
echo $case."\n";
}
}
}
echo '<h2>F2L</h2>';
echo "<p>This list all the F2L cases when the edge is properly oriented. Most of these case are to be understood rarher than learned. Usually, what is done is simply to pair the edge and the corner so they can be inserted in 3 moves and then do so. Understanding these will allow to adapt them in order to use more advanced techniques such as partial edge control later on. If pieces are in other slots, move them on the U layer and use the solutions below. Most of the alternatives presented make looking ahead harder, so I avoid using them before the last slot.</p>";
render_set(array(
'Basics inserts' => array(
new F2l("U R U' R'"),
new F2l("U' R' U R"),
new F2l("R U R'"),
new F2l("R' U' R"),
),
'Corner right' => array(
new F2l("R U' R' U R U' R' U2 R U' R'"),
new F2l("R' U R U' R' U R U2 R' U R"),
new F2l("U2 R U' R' U' R U R'", array("U' R U R' U R U R'")),
new F2l("U2 R' U R U R' U' R", array("U R' U' R U' R' U' R")),
new F2l("U' R U' R' U R U R'"),
new F2l("U R' U R U' R' U' R"),
),
'Corner front' => array(
new F2l("R U R' U2 R U' R' U R U' R'", array("R r' U r U' r' U' M'")),
new F2l("R' U' R U2 R' U R U' R' U R", array("M' U' r' U r U r' R")),
new F2l("U' R U2 R' U2 R U' R'"),
new F2l("U R' U2 R U2 R' U R"),
new F2l("U' R U R' U2 R U' R'"),
new F2l("U R' U' R U2 R' U R"),
),
'Corner up' => array(
new F2l("U R U' R' U' R U' R' U R U' R'", array("U2 R2 U2 R' U' R U' R2")),
new F2l("U' R' U R U R' U R U' R' U R", array("U2 R2 U2 R U R' U R2")),
new F2l("U2 R U R' U R U' R'"),
new F2l("U2 R' U' R U' R' U R"),
new F2l("U R U2 R' U R U' R'"),
new F2l("U' R' U2 R U' R' U R"),
new F2l("R U2 R' U' R U R'"),
new F2l("R' U2 R U R' U' R"),
),
'Slotted corner' => array(
new F2l("F' R U R' U' R' F R", array("R' F' R U R U' R' F")),
new F2l("F R2 U R U' R2 F'"),
new F2l("R U R' U' R U R'"),
new F2l("R' U' R U R' U' R"),
new F2l("R U' R' U R U' R'"),
new F2l("R' U R U' R' U R"),
),
'Slotted edge' => array(
new F2l("U R U R' U2 R U R'"),
new F2l("U' R' U' R U2 R' U' R"),
new F2l("U2 R' F R F' U2 R U R'", array("U' R U M' U' R' U R U r'")),
new F2l("U R' U' R r' U R U' R' U' r"),
new F2l("U' R U' R' U2 R U' R'"),
new F2l("U R' U R U2 R' U R"),
new F2l("U2 R U R' U' y' R' U R y", array("U M' U R U' r' R U' R'")),
new F2l("U R' F R' F' R U' R"),
new F2l("U R U' R' U R U' R' U R U' R'"),
new F2l("U' R' U R U' R' U R U' R' U R"),
new F2l("U' R' F R F' R U' R'"),
new F2l("R' U R' F R F' R"),
),
'Slotted corner and edge' => array(
new F2l("R U' R' U R U2 R' U R U' R'"),
new F2l("R' U R U' R' U2 R U' R' U R"),
new F2l("R U' M' U' r' U2 r U r'"),
new F2l("R' U R r' U r U2 r' U' r"),
new F2l("R U' R' U' R U R' U2 R U' R'"),
new F2l("R' U R U R' U' R U2 R' U R"),
new F2l("r U' r' U2 r U r' R U R'"),
new F2l("r' U r U2 r' U' M' U' R"),
new F2l("R U' R' d R' U2 R U2 R' U R y", array("R2 U2 F R2 F' U2 R' U R")),
new F2l("R' U R F R U R2 U' R F'"),
),
));
echo '<h2>PLL</h2>';
echo "<p>Diagonal cases are the worst, so it is worth trying to avoid them. this can be done by using alternative OLL when the corner permutation is defavorable.</p>";
render_set(array(
'EPLL' => array(
new Pll('Ua', "M2' U M U2 M' U M2'", 4, "", array(
"M2' U M' U2 M U M2'",
"R U' R U R U R U' R' U' R2",
"R2 U' R' U' R U R U R U' R",
)),
new Pll('Ub', "M2' U' M U2 M' U' M2'", 4, "", array(
"M2' U' M' U2 M U' M2'",
"R2 U R U R' U' R' U' R' U R'",
"R' U R' U' R' U' R' U R U R2",
)),
new Pll('H', "M2' U M2' U2 M2' U M2'", 1),
new Pll('Z', "M U M2' U M2' U M U2 M2' U'", 2),
),
'CPLL' => array(
new Pll('Aa', "r2 F2' r' U' r F2' r' U r'", 4, "The F2' are done with the right hand ring and pinky", array(
"l' U R' D2 R U' R' D2 R2 R l",
)),
new Pll('Ab', "r2' B2' r U r' B2' r U' r", 4, "", array(
"l U' R D2' R' U R D2' R2'",
)),
new Pll('E', "l U' R' D R U R' D' R U R' D R U' R' D' x", 2),
),
'G perms' => array(
new Pll('Ga', "R2 U R' U R' U' R U' R2 U' D R' U R D'", 4),
new Pll('Gb', "D R' U' R U D' R2 U R' U R U' R U' R2'", 4),
new Pll('Gc', "R2' U' R U' R U R' U R2 U D' R U' R' D", 4),
new Pll('Gd', "D' R U R' U' D R2 U' R U' R' U R' U R2", 4),
),
'Adjacent' => array(
new Pll('Ra', "R U' R' U' R U R D R' U' R D' R' U2 R'", 4),
new Pll('Rb', "R2' F R U R U' R' F' R U2' R' U2 R", 4),
new Pll('Ja', "l' R' F R F' R U2' r' U r U2' x'", 4),
new Pll('Jb', "R U R' F' R U R' U' R' F R2 U' R'", 4),
new Pll('T', "R U R' U' R' F R2 U' R' U' R U R' F'", 4),
new Pll('F', "R' U' F' R U R' U' R' F R2 U' R' U' R U R' U R", 4, "", array(
"R' U2' R' d' R' F' R2 U' R' U R' F R U' F",
)),
),
'Diagonal' => array(
new Pll('V', "R U' R U R' D R D' R U' D R2' U R2' D' R2", 4, "", array(
"R' U R' d' R' F' R2 U' R' U R' F R F"
)),
new Pll('Y', "F R U' R' U' R U R' F' R U R' U' R' F R F'", 4),
new Pll('Na', "R U R' U R U R' F' R U R' U' R' F R2 U' R' U2 R U' R'", 1),
new Pll('Nb', "r' D' F r U' r' F' D r2 U r' U' r' F r F'", 1),
),
));
echo '<h2>OLL</h2>';
echo "<p>Because the Dot cases are the worse, we'll try to avoid them by doign partial edge control during F2L or using different variations to insert the last pair.</p>";
render_set(array(
'All edges oriented' => array(
new Oll('Sune', "R U R' U R U2' R'", 4),
new Oll('Anti Sune', "R U2' R' U' R U' R'", 4),
new Oll('H', "R U2 R' U' R U R' U' R U' R'", 2),
new Oll('Pi', "R U2' R2' U' R2 U' R2' U2' R", 4),
new Oll('T', "R U R D R' U' R D' R2'", 4),
new Oll('L', "R2' D' R U' R' D R U R", 4),
new Oll('U', "R2' D' R U2 R' D R U2' R", 4),
),
'T Shapes' => array(
new Oll('T6', "F R U R' U' F'", 4),
new Oll('T9', "R U R' U' R' F R F'", 4),
),
'Square shapess' => array(
new Oll('', "r U2' R' U' R U' r'", 4),
new Oll('', "r' U2' R U R' U r", 4),
),
'C shapes' => array(
new Oll('', "R U R2 U' R' F R U R U' F'", 4, "Do F' with the right ring finger."),
new Oll('', "R' U' R' F R F' U R", 4),
),
'W shapes' => array(
new Oll('', "R U R' U R U' R' U' R' F R F'", 4),
new Oll('', "R U R2 F' U' F U R2 U2' R'", 4),
),
'Edge flips' => array(
new Oll('', "r U R' U' M U R U' R'", 4),
new Oll('', "R U R' U' M' U R U' r'", 2),
),
'P shapes' => array(
new Oll('', "R' U' F U R U' R' F' R", 4),
new Oll('', "R U B' U' R' U R B R'", 4, "Do the first U by pushing with your left index finger and B' by pushing with your right index finger."),
new Oll('', "R' U' F' U F R", 4),
new Oll('', "F U R U' R' F'", 4),
),
'I shapes' => array(
new Oll('', "F U R U' R' U R U' R' F'", 4),
new Oll('', "r' U' r U' R' U R U' R' U R r' U r", 2),
new Oll('', "R U R' U R U' B U' B' R'", 4, "You can do the final Bs using your right index finger."),
new Oll('', "r U2' R' U' R2 r' U R' U' r U' r'", 2),
),
'Fish shapes' => array(
new Oll('', "R U R' U' R' F R2 U R' U' F'", 4),
new Oll('', "R U R' U R' F R F' R U2 R'", 4),
new Oll('', "R U2 R2 F R F' R U2 R'", 4),
new Oll('', "F R U' R' U' R U R' F'", 4),
),
'Knight shapes' => array(
new Oll('', "F U R U' R2' F' R U R U' R'", 4, "", array(
"r U' r' U' r U r' F' U' F",
)),
new Oll('', "R' F R U R' F' R F U' F'", 4),
new Oll('', "r U r' R U R' U' r U' r'", 4),
new Oll('', "r' U' M' U' R U r' U r", 4),
),
'Awkward shapes' => array(
new Oll('', "r2' D' r U r' D r2 U' r' U' r", 4),
new Oll('', "r' D' r U' r' D r2 U' r' U r U r'", 4),
new Oll('', "R U R' U R U2' R' F R U R' U' F'", 4),
new Oll('', "R' U' R U' R' U2' R F R U R' U' F'", 4),
),
'L shapes' => array(
new Oll('', "F R U R' U' R U R' U' F'", 4),
new Oll('', "F R' F' R U2' R U' R' U R U2' R'", 4),
new Oll('', "r U' r2 U r2 U r2 U' r", 4),
new Oll('', "r' U r2 U' r2 U' r2 U r'", 4),
new Oll('', "r' U' R U' R' U R U' R' U2' r", 4),
new Oll('', "r U R' U R U' R' U R U2' r'", 4),
),
'Lightning shapes' => array(
new Oll('', "r U R' U R U2 r'", 4),
new Oll('', "r' U' R U' R' U2 r", 4),
new Oll('', "R2 r' U R' U R U2 R' U M'", 4),
new Oll('', "R' M' U' R U' R' U2 R U' M", 4),
new Oll('', "R B' R' U' R U B U' R'", 4, "Do the B' by pushing with your left index finger and the B with your right inde finger."),
new Oll('', "R' F R U R' U' F' U R", 4),
),
'Dot shapes' => array(
new Oll('', "R U' R2' D' r U' r' D R2 U R'", 2),
new Oll('', "R U' R2' D' r U r' D R2 U R'", 4),
new Oll('', "r' R2 U R' U r U2' r' U M'", 4),
new Oll('', "M U' r U2' r' U' R U' R' M'", 4),
new Oll('', "F R' F' R2 r' U R U' R' U' M'", 4),
new Oll('', "r U R' U R U2' r2' U' R U' R' U2' r", 4),
new Oll('', "M U R U R' U' r R2 F R F'", 4),
new Oll('', "r U R' U' M2 U R U' R' U' M'", 1),
),
));
echo '<h2>Advanced F2L</h2>';
echo '<p>This is not one but several sets to improve F2L. For the most part, cases are easily deduced, but for effisciency, systematisation is helpful. The sets presented are about how to use empty slots to simplify bad cases, how to handle misloted pieces and a list of all cases where the edge is misoriented.</p>';
render_set(array(
'Empty slot on R' => array(
new F2lBr("R' U2 R2 U R'"),
new F2lFr("R U2 R2 U' R"),
new F2lBr("U' R' U R U' R U R'"),
new F2lFr("U R U' R' U R' U' R"),
new F2lBr("R2 U' R' U R2"),
new F2lFr("R2 U R U' R2"),
new F2lBr("U2 D R' U R D'"),
new F2lFr("U2 D' R U' R' D"),
new F2lBr("U' D R' U' R D'"),
new F2lFr("U D' R U R' D"),
new F2lBr("D' R' F R F' R U' R' U D"),
new F2lFr("D R' U R' F R F' R D'"),
),
'Empty slot on F' => array(
new F2lFl("F r U r' F'"),
new F2lFl("D R' F R F' R U' R' U D'"),
),
'Basic insert, misoriented' => array(
new F2l("y' U' R' U R y"),
new F2l("r' U' R U M'"),
new F2l("F' U' F"),
new F2l("f R f'"),
),
'Corner right, misoriented' => array(
new F2l("d R' U' R U2 R' U R y", array("U' r U' R' U R U r'")),
new F2l("d R' U2 R U2 R' U R y", array("r' U2 R2 U R2 U r")),
new F2l("R U' R' U d R' U' R y", array("U M' U R U' r' U' R U R'")),
),
'Corner front, misoriented' => array(
new F2l("d R' U R U' R' U' R y", array("M' U' R U R' U' R U2 r'")),
new F2l("U' R U' R' d R' U' R y", array("U r U R' U' R2 r' U' R'")),
new F2l("U' R U2' R' d R' U' R y", array("U' R U2 R' U2 R2 r' U' R' U M'")),
),
'Corner up, misoriented' => array(
new F2l("y' R' U2 R U R' U' R y"),
new F2l("U' R U' R2' F R F' R U' R'"),
new F2l("r U' r' U2 r U r'"),
new F2l("U' R U R2' F R F' R U' R'"), // R' F R' F' R2 U' R' U R from the back
),
));
?>
</body>