• 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!

Super set notation to normal big cube notation converter

abunickabhi

Super Moderator
Staff member
Joined
Jan 9, 2014
Messages
9,572
Location
Yo
WCA
2013GHOD01
YouTube
Visit Channel
Currently, I have a big sheet of x-center 5-cycles (10k+ algs), but the problem is that all the algs are in superset notation, and I have to read it out and do it on the cube. I cannot use cubedb or alg.cubing to enter the alg as superset notation is not allowed there.

Few days back, I discussed with @cmowla a few days back, and got to know about superset notation. (http://www.randelshofer.ch/rubik/professor/doc/supersetENG_5x5.html)

The few sets of turn types that exist in superset notation that need to be mapped to normal bigcube scramble notation are:
  1. Face twists
  2. Tier twists
  3. Numbered layer twists
  4. Numbered range twists
  5. Verge twists
  6. Mid-layer twists
  7. Wide-layer twists
  8. Slice twists
  9. Slice range twists
  10. Cube rotations
I am fine with parser on any platforrm, python, java, C++, VisualC, regex.
 
Python:
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 18 21:34:35 2021
@author: Alexander & abhij
"""

import re
string = "TR' L SF NF2 TF2 L NU' L' NF2 L NR2 NU R2 NU' NR2 NU SR2 TF"

string = string.replace("N", "2")

string = string.replace('TR','r').replace('TL','l').replace('TU','u').replace('TD','d').replace('TF','f').replace('TB','b')

string = re.sub(r'(SF )(?!\')', 'F B\' ', string)
string = re.sub(r'(SF\' )(?!\')', 'F\' B ', string)
string = re.sub(r'(SF2 )(?!\')', 'F2 B2 ', string)
string = re.sub(r'(SR )(?!\')', 'R L\' ', string)
string = re.sub(r'(SR\' )(?!\')', 'R\' L ', string)
string = re.sub(r'(SR2 )(?!\')', 'L2 R2 ', string)
string = re.sub(r'(SU )(?!\')', 'U D\' ', string)
string = re.sub(r'(SU\' )(?!\')', 'U\' D ', string)
string = re.sub(r'(SU2 )(?!\')', 'U2 D2 ', string)

print(string)

My first python script a modification of your code that N part was very easy to short it up the rest i did not bother yet
 
Python:
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 18 21:34:35 2021
@author: Alexander & abhij
"""

import re
string = "TR' L SF NF2 TF2 L NU' L' NF2 L NR2 NU R2 NU' NR2 NU SR2 TF"

string = string.replace("N", "2")

string = string.replace('TR','r').replace('TL','l').replace('TU','u').replace('TD','d').replace('TF','f').replace('TB','b')

string = re.sub(r'(SF )(?!\')', 'F B\' ', string)
string = re.sub(r'(SF\' )(?!\')', 'F\' B ', string)
string = re.sub(r'(SF2 )(?!\')', 'F2 B2 ', string)
string = re.sub(r'(SR )(?!\')', 'R L\' ', string)
string = re.sub(r'(SR\' )(?!\')', 'R\' L ', string)
string = re.sub(r'(SR2 )(?!\')', 'L2 R2 ', string)
string = re.sub(r'(SU )(?!\')', 'U D\' ', string)
string = re.sub(r'(SU\' )(?!\')', 'U\' D ', string)
string = re.sub(r'(SU2 )(?!\')', 'U2 D2 ', string)

print(string)

My first python script a modification of your code that N part was very easy to short it up the rest i did not bother yet
Thanks for the edit.

I converted about 10k superset notation algs to normal notation using this script.
 
Back
Top