Skip to content

Commit

Permalink
solver package
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianliaw committed Nov 21, 2014
1 parent a309895 commit fef0eb4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pycuber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

__all__ = ["Cube", "Cubie", "Centre", "Corner", "Edge", "Square", "Step", "Algo"]
__title__ = "PyCuber"
__version__ = "0.1b3"
__version__ = "0.1b4"
__author__ = "Adrian Liaw"
__license__ = "MIT"
15 changes: 15 additions & 0 deletions pycuber/solver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
PyCuber solvers can be found here.
Usage:
>>> import pycuber as pc
>>> from pycuber.solver import CFOPSolver
>>> rand_alg = pc.Algo().random()
>>> cube = pc.Cube()
>>> cube(rand_alg)
>>> solver = CFOPSolver(cube)
>>> solver.solve()
"""

from cfop import CFOPSolver
4 changes: 2 additions & 2 deletions pycuber/solver/cfop/oll.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Module for solving Rubik's Cube OLL.
"""

import csv
import csv, os
from pycuber import *

with open("cfop/oll_algos.csv", "r") as f:
with open(os.path.join(os.path.dirname(__file__), "oll_algos.csv"), "r") as f:
reader = csv.reader(f, delimiter=",")
algo_dict = {}
for line in reader:
Expand Down
4 changes: 2 additions & 2 deletions pycuber/solver/cfop/pll.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Module for solving Rubik's Cube PLL.
"""

import csv
import csv, os
from pycuber import *

with open("cfop/pll_algos.csv", "r") as f:
with open(os.path.join(os.path.dirname(__file__), "pll_algos.csv"), "r") as f:
reader = csv.reader(f, delimiter=",")
algo_dict = {}
for name, rec_id, algo in reader:
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@

setup(
name = "pycuber",
version = "0.1b3",
version = "0.1b4",
description = "Rubik's Cube in Python",
long_description = long_desc,
url = "http://github.com/adrianliaw/PyCuber",
license = "MIT",
author = "Adrian Liaw",
author_email = "[email protected]",
packages = ["pycuber"],
packages = ["pycuber", "pycuber.solver", "pycuber.solver.cfop"],
package_dir = {"pycuber":"pycuber"},
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -74,4 +74,7 @@
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Mathematics",
],
package_data = {
"pycuber.solver.cfop": ["*.csv"],
},
)

0 comments on commit fef0eb4

Please sign in to comment.