Super set notation to normal big cube notation converter

abunickabhi

Legend
Joined
Jan 9, 2014
Messages
14,557
Location
Yo
WCA ID
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