Last active
July 31, 2025 09:40
-
-
Save 0racle/ceebc2fdb9960044538812fa8d07376e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load 'tangentstorm/j-kvm/vm' | |
NB. Turn face | |
T =: {{ |:@|.^:x y }} | |
NB. Y rotation | |
Ya =: [: (_1 1 T"_1 ])&.((2 1;0 1)&{) (1 |. ])&.(1&{) | |
Yb =: Ya^:3 :. Ya | |
Y =: Ya :. Yb | |
NB. X rotation | |
Xa =: {{ | |
o =. 0 5 2 3, 4 9 6 1,8 7 10 11 | |
r =. 0 0 0 0,_1 0 1 2,0 2 0 0 | |
3 4 $ r T"0 2 o { ,/ y | |
}} | |
Xb =: Xa^:3 :. Xa | |
X =: Xa :. Xb | |
NB. U moves | |
Ua =: [: 1&T&.((<0 1)&{) 1&|.&.((1 0 0;1 1 0;1 2 0;1 3 0)&{) | |
Ub =: Ua^:3 :. Ua | |
NB. other face moves | |
Fa =: Ua&.X | |
Fb =: Ub&.X | |
Ra =: Fa&.Y | |
Rb =: Fb&.Y | |
Ba =: Ra&.Y | |
Bb =: Rb&.Y | |
La =: Ba&.Y | |
Lb =: Bb&.Y | |
Da =: Fa&.X | |
Db =: Fb&.X | |
Parse =: {{ | |
f =. ({. y), 'ab' {~ '''' e. y | |
r =. ": 1 + '2' e. y | |
< '(',f,'^:',r,')' | |
}} | |
Show =: {{ | |
c =. 3 3&$"0 [ 0 1 0 0,2 3 4 5,:0 6 0 0 | |
col =. (3 $ 256) #: 0 16777215 16744192 56576 16711680 255 16776960 | |
stdout col vm 4 ([ # #"1) ,./^:2 ". ;:inv |. 'c' ; Parse@> cut y | |
}} | |
Show {{)nF2 U2 R2 D' R2 F2 U2 F2 U' B2 R' U2 B' D' F' U2 B L B' D2}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment