Skip to content

Instantly share code, notes, and snippets.

@sebassdc
Created March 1, 2017 10:18
Show Gist options
  • Save sebassdc/7fc583b6e86ca2130ea764ce90adc43c to your computer and use it in GitHub Desktop.
Save sebassdc/7fc583b6e86ca2130ea764ce90adc43c to your computer and use it in GitHub Desktop.
#! /usr/bin/python3
"""cliube
Usage:
cliube inverse <moves>
cliube optimise <moves>
cliube (-h | --help)
cliube --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import pycuber as pc
def genInverse(s):
f = pc.Formula(s)
f.optimise()
f.reverse()
return f
def optimise(s):
f = pc.Formula(s)
f.optimise()
return f
if __name__ == '__main__':
args = docopt(__doc__, version='cliube 0.0.1')
cleaned_moves = args["<moves>"].replace("(", "").replace(")", "")
if args["inverse"]:
print(genInverse(cleaned_moves))
if args["optimise"]:
print(optimise(cleaned_moves))
@sebassdc
Copy link
Author

sebassdc commented Mar 1, 2017

depende de los paquetes pycuber y docopt
pip install pycuber docopt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment