sourcelibs/Eigencube/demos/solve.xtl
1⍝!/usr/bin/env xetal
2⍝ Eigencube in use: a random scramble, its stickers, a solution, and the
3⍝ cube after it. Run with "just demo Eigencube solve".
4ᵉᶜ⁼u̲se< "Eigencube"
5sc ← r̲oll! 20 r̲eshape 12
6"scramble: " c̲at ᵉᶜn̲ame sc
7x ← sc ᵉᶜd̲o ᵉᶜsolved
8⍝ The stickers, a face per row (U D F B R L), each cell the face its
9⍝ color belongs on: 1 to 6, white, yellow, green, blue, red, orange.
10ᵉᶜs̲tickers x
11(sol, lens, e) ← 1 ᵉᶜs̲olve x
12"solution: " c̲at ᵉᶜn̲ame sol
13"moves: " c̲at f̲ormat t̲ally sol
14⍝ The moves each stage took: the top layer a cubelet at a time
15⍝ (stages 1 to 9), the middle layer (10 to 17), the bottom edges (18
16⍝ to 25) and the bottom corners' places (26 to 29), then the
17⍝ endgame's corner twists.
18lens c̲at e
19ᵉᶜs̲tickers sol ᵉᶜd̲o x
20"solved: " c̲at f̲ormat ᵉᶜs̲olved? sol ᵉᶜd̲o x