• Welcome to the Speedsolving.com, home of the web's largest puzzle community!
    You are currently viewing our forum as a guest which gives you limited access to join discussions and access our other features.

    Registration is fast, simple and absolutely free so please, join our community of 40,000+ people from around the world today!

    If you are already a member, simply login to hide this message and begin participating in the community!

cube.sed

qwr

Member
Joined
Jul 24, 2019
Messages
3,983
YouTube
Visit Channel

cube3d.gif


if you don't know what sed is, it's basically a string search-and-replace tool. So basically the cube is represented internally as

Code:
# internal representation (largely speffz + weird extra characters):
#     AaB
#     d!b
#     DcC
# EeF IiJ MmN QqR
# h@f l#j p$n t%r
# HgG LkK PoO TsS
#     UuV
#     x^v
#     XwW


# initial cube state
1 {
x
s/$/AaBd!bDcCEeFIiJMmNQqRh@fl#jp$nt%rHgGLkKPoOTsSUuVx^vXwW/
x
}

then moves are represented as string operations like

Code:
/^U/ {
x
#   A         B           D         C    D   A   C   B
s/\(.\)\(.\)\(.\)\(...\)\(.\)\(.\)\(.\)/\5\2\1\4\7\6\3/
#        a         d         b         c      d   c   a   b
s/\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)/\1\4\3\8\5\2\7\6/
#             E          I          M          Q      I   M   Q   E
s/\(.\{9\}\)\(.\)\(..\)\(.\)\(..\)\(.\)\(..\)\(.\)/\1\4\3\6\5\8\7\2/
#              e          i          m          q      i   m   q   e
s/\(.\{10\}\)\(.\)\(..\)\(.\)\(..\)\(.\)\(..\)\(.\)/\1\4\3\6\5\8\7\2/
#              F          J          N          R      J   N   R   F
s/\(.\{11\}\)\(.\)\(..\)\(.\)\(..\)\(.\)\(..\)\(.\)/\1\4\3\6\5\8\7\2/
b next
}

This is actually not too far off from how a normal cube sim would represent internal state (with some optimizations)
 
Back
Top