Created
March 1, 2017 10:18
-
-
Save sebassdc/7fc583b6e86ca2130ea764ce90adc43c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
depende de los paquetes pycuber y docopt
pip install pycuber docopt