Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ask for alg input
- io.write("put in your algorithm: ")
- local alg = io.read()
- -- translation tables to translate
- local trans1 = {
- ["R'"] = "rv", ["U'"] = "u>", ["L'"] = "l^", ["F'"] = "f<", ["D'"] = "d<", ["B'"] = "b>", ["M'"] = "m^", ["E'"] = "e<", ["S'"] = "s<"
- }
- local trans2 = {
- ["R"] = "r^", ["U"] = "u<", ["L"] = "lv", ["F"] = "f>", ["D"] = "d>", ["B"] = "b<", ["M"] = "mv", ["E"] = "e>", ["S"] = "s>"
- }
- local trans3 = {
- ["R2"] = "r2", ["U2"] = "u2", ["L2"] = "l2", ["F2"] = "f2", ["D2"] = "d2", ["B2"] = "b2", ["M2"] = "m2", ["E2"] = "e2", ["S2"] = "s2"
- }
- -- wide moves because someone asked
- local trans4 = {
- ["Rw'"] = "Rv", ["Uw'"] = "U>", ["Lw'"] = "L^", ["Fw'"] = "F<", ["Dw'"] = "D<", ["Bw'"] = "B>", ["Mw'"] = "M^", ["Ew'"] = "E<", ["Sw'"] = "S<"
- }
- local trans5 = {
- ["Rw"] = "R^", ["Uw"] = "U<", ["Lw"] = "Lv", ["Fw"] = "F>", ["Dw"] = "D>", ["Bw"] = "B<", ["Mw"] = "Mv", ["Ew"] = "E>", ["Sw"] = "S>"
- }
- local trans6 = {
- ["Rw2"] = "R2", ["Uw2"] = "U2", ["Lw2"] = "L2", ["Fw2"] = "F2", ["Dw2"] = "D2", ["Bw2"] = "B2", ["Mw2"] = "M2", ["Ew2"] = "E2", ["Sw2"] = "S2"
- }
- -- translate the moves to neomoves
- print((alg:gsub("%S+", trans1):gsub("%S+", trans2):gsub("%S+", trans3):gsub("%S+", trans4):gsub("%S+", trans5):gsub("%S+", trans6)))
Advertisement
Add Comment
Please, Sign In to add comment